首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在python2.7中安装pytorch?

如何在python2.7中安装pytorch?
EN

Stack Overflow用户
提问于 2019-09-08 01:24:24
回答 4查看 9.8K关注 0票数 3

我在虚拟环境中使用python2.7。我尝试在python2.7中安装pytorch,但得到以下错误:

代码语言:javascript
复制
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

  - pytorch-cpu -> python[version='3.5.*|3.6.*']
  - pytorch-cpu -> python[version='>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to.  Your current python version
is (python=2.7).  Note that conda will not change your python version to a different minor version
unless you explicitly specify that.

The following specifications were found to be incompatible with each other:



Package wheel conflicts for:
python=2.7 -> pip -> wheel
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip -> wheel
Package vc conflicts for:
python=2.7 -> sqlite[version='>=3.27.2,<4.0a0'] -> vc[version='14.*|>=14,<15.0a0|>=14.1,<15.0a0']
python=2.7 -> vc[version='9.*|>=9,<10.0a0']
pytorch-cpu -> numpy[version='>=1.11'] -> vc[version='14|14.*|>=14,<15.0a0']
pytorch-cpu -> vc[version='>=14.1,<15.0a0']
Package cffi conflicts for:
pytorch-cpu -> cffi
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip -> requests -> urllib3[version='>=1.21.1,<1.25'] -> cryptography[version='>=1.3.4'] -> cffi[version='>=1.7']
python=2.7 -> pip -> requests -> urllib3[version='>=1.21.1,<1.25'] -> cryptography[version='>=1.3.4'] -> cffi[version='>=1.7']
Package pip conflicts for:
python=2.7 -> pip
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip
Package setuptools conflicts for:
python=2.7 -> pip -> setuptools
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip -> setuptools
Package msgpack-python conflicts for:
python=2.7 -> pip -> cachecontrol -> msgpack-python
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip -> cachecontrol -> msgpack-python

我尝试了conda install pytorch-cpu和pytorch -c link(https://pytorch.org/get-started/locally/)。但它并没有起作用。那么在python版本2.7中安装torch应该怎么做呢?我想安装pytorch cpu版本。

请帮助:)

EN

回答 4

Stack Overflow用户

发布于 2019-09-08 01:55:03

这是指向PyTorch official download page的链接

在这里,您可以根据您的环境和操作系统选择python版本(2.7)和CUDA (无)以及其他相关详细信息。

其他有用的链接:

票数 2
EN

Stack Overflow用户

发布于 2019-09-08 01:33:35

似乎pytorch尝试安装一些需要python >= 3.6版本的包。

代码语言:javascript
复制
Package wheel conflicts for:
python=2.7 -> pip -> wheel
pytorch-cpu -> python[version='>=3.6,<3.7.0a0'] -> pip -> wheel

您必须在命令中指定要为哪个python版本安装pytorch

票数 1
EN

Stack Overflow用户

发布于 2020-03-12 16:33:05

对我来说,链接https://www.learnopencv.com/installing-deep-learning-frameworks-on-ubuntu-with-cuda-support/中的方法起作用了。

我是这样做的:

!pip install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57835948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档