英文:
Cannot install torch 1.6.0 on python 3.6.1 while PyPi says it is compatible
问题 {#heading}
我正在尝试安装Torch版本1.6.0。
在Pypi页面上说明Torch 1.6.0与Python版本>= 3.6.1兼容。
然而,当尝试在Python 3.6.1上使用pip安装Torch时,出现以下错误。
(.venv) python --version
>>> python 3.6.1
`(.venv) pip install torch==1.6.0
>>> ERROR: Could not find a version that satisfies the requirement torch==1.6.0 (from versions: 1.7.0)
>>> ERROR: No matching distribution found for torch==1.6.0
`
我还尝试在Python版本3.7.9、3.8.0、3.9.7、3.10.0上安装它。
如何解决这个问题?
如果Torch 1.6.0不能安装在这个Python版本上,那么可以安装在哪个版本上?
更多细节:
我使用的是pip 22.3.1。虚拟环境是使用Visual Studio Code创建的。
英文:
I am trying to install Torch version 1.6.0.
On the Pypi page it states that Torch 1.6.0 is compatible with Python >= 3.6.1.
However, the following error is thrown when trying to install Torch using pip on Python 3.6.1.
(.venv) python --version
>>> python 3.6.1
`(.venv) pip install torch==1.6.0
>>> ERROR: Could not find a version that satisfies the requirement torch==1.6.0 (from versions: 1.7.0)
>>> ERROR: No matching distribution found for torch==1.6.0
`
I have also tried installing it on python versions 3.7.9, 3.8.0, 3.9.7, 3.10.0.
How can I resolve this issue?
If Torch 1.6.0 cannot be installed on this Python version, on which version can it be installed?
Further details:
I am using pip 22.3.1. The virtual environment is created using Visual Studio Code.
答案1 {#1}
得分: 3
你可以按照文档这样安装它:
pip install torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
根据你的CUDA安装选择相应的CUDA版本。 英文:
You can install it according to docs like this:
pip install torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
Choose CUDA
version according to your CUDA
installation.
答案2 {#2}
得分: 3
在Pypi页面上写着Torch 1.6.0与Python >= 3.6.1兼容。
但这并未涉及操作系统的兼容性或正确的whl文件是否可用。如果你查看文件标签页,
你会看到:
torch-1.6.0-cp38-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp38-cp38-manylinux1_x86_64.whl
torch-1.6.0-cp37-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp37-cp37m-manylinux1_x86_64.whl
torch-1.6.0-cp36-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp36-cp36m-manylinux1_x86_64.whl
所以只有Python 3.6和3.7的whl文件,而且只适用于MacOS和manylinux。
然而,正如doneforaiur指出的,你可以从https://download.pytorch.org/whl/torch_stable.html获取whl文件。 英文:
> On the Pypi page it states that Torch 1.6.0 is compatible with Python >= 3.6.1
That says nothing about OS compatibility or the availability of the correct whl files. If you check the files tab
you will see
torch-1.6.0-cp38-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp38-cp38-manylinux1_x86_64.whl
torch-1.6.0-cp37-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp37-cp37m-manylinux1_x86_64.whl
torch-1.6.0-cp36-none-macosx_10_9_x86_64.whl
torch-1.6.0-cp36-cp36m-manylinux1_x86_64.whl
So only whl files for python 3.6 and 3.7 and only for MacOs and manylinux.
As doneforaiur has pointed out though, whl files are available from https://download.pytorch.org/whl/torch_stable.html