python - 如何在python2.7中安装pytorch?

标签 python python-2.7 pytorch torch

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

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 -c pytorch 和链接( https://pytorch.org/get-started/locally/ )。但它没有起作用。那么我应该如何在python version2.7中安装torch呢?我想安装pytorch cpu版本。

请帮忙:)

最佳答案

这是 PyTorch official download page 的链接

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

其他有用的链接:

关于python - 如何在python2.7中安装pytorch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57835948/

相关文章:

python - 在 Heroku 上找不到与 torch==1.5.0+cpu 匹配的分布

python - 使用 DseAuthenticator 和 DseAuthorizer 从 Windows 将 python 连接到 cassandra 集群

python - "self"在 selenium python 代码中做什么?

pytorch - (Pytorch)为什么 conv2d 结果都不同。它们的数据类型都是整数,没有 float

numpy - 如何索引/切片未知维度的 PyTorch 张量/numpy 数组的最后一个维度

python - 使用Python处理来自url的img

python - 如何确定动态 SQLAlchemy 关系的类型(例如多对一)?

python -/bin/sh - 来自 Python 的非交互式用法

python - Sqlalchemy pyodbc 无 DNS URL 连接字符串似乎不起作用

python - Kivy - 添加和删除标签