I recently upgraded to Python 3.11 and proceeded to install the libraries I typically use for 3.11. I went through my list one by one with pip
.
我最近升级到了Python3.11,并开始安装我通常在3.11中使用的库。我和皮普把我的清单一一看了一遍。
When I tried to install PyTorch, I got an error which says:
当我尝试安装PyTorch时,我收到一个错误,显示:
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
None of the suggestions I could find on pytorch.com resolved the issue.
我在pytorch.com上找到的建议都没有解决这个问题。
What went wrong, and what do I need to do in order to install PyTorch properly?
哪里出了问题,我需要做什么才能正确安装PyTorch?
更多回答
It works now on Windows too!
它现在也可以在Windows上运行了!
优秀答案推荐
As of now, PyTorch only provides a Linux build with python 3.11
You can check all available wheels here.
到目前为止,PyTorch只提供了一个带有python3.11的Linux版本,你可以在这里查看所有可用的轮子。
https://download.pytorch.org/whl/torch/
https://download.pytorch.org/whl/torch/
I saw this issue on github: https://github.com/pytorch/pytorch/issues/86566 it looks like PyTorch doesn't support 3.11 yet.
Apparently there's a nightly build that you can try to use, I haven't tested it though.
我在gihub上看到了这个问题:https://github.com/pytorch/pytorch/issues/86566,它看起来还不支持3.11。显然,你可以尝试使用一个夜间版本,不过我还没有测试过它。
This works for me. Installs the nightly version of torch.
这对我很管用。安装每晚版本的Torch。
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
[TL;DR] In general, to get full Python 3.11 support it's advisable to upgrade torch
to version 2.x.
[TL;DR]总的来说,要获得完整的Python3.11支持,建议将Torch升级到2.x版。
More info
更多信息
From my installation experience the compatibility matrix of torch
vs. Python vs. OS type vs. CUDA version vs. torchvision
version has been pretty complex during the switch from torch
1.x to 2.x:
根据我的安装经验,在从Torch 1.x到2.x的转换过程中,Torch、Python、OS类型、CUDA版本和Torchvision版本的兼容性矩阵非常复杂:
The earliest version of torch
supporting Python 3.11:
支持Python3.11的Torch的最早版本:
- under Linux was 1.13.0 (unless you wanted also
torchvision
, then 2.0.0)
- under Windows was 2.0.0
- under CUDA 11.5 or earlier was None
- under CUDA (11.6 or 11.7) was (1.13.0 and 1.13.1)
- under CUDA 11.8 was 2.0.0
- under CUDA 12.x is still None
- with
torchvision
under Linux or Windows was 2.0.0 (this is because the 1st version of torchvision
compatible with Python 3.11 is torchvision==0.15.0+cu117
, which depends on torch==2.0.0+cu117
)
更多回答
Nightly build for Python 3.11 is only available on Linux at present
目前,针对Python3.11的夜间构建仅在Linux上可用
worked for me. thanks
对我很管用。谢谢
我是一名优秀的程序员,十分优秀!