【问题标题】:pytorch previous version installation conflict in my local machine我本地机器上pytorch以前版本安装冲突
【发布时间】:2021-02-17 04:24:16
【问题描述】:

我正在尝试在 python 2.7 环境中使用以下 conda 命令安装 PyTorch 和 Torchvision

conda install pytorch==1.1.0 torchvision==0.3.0 -c pytorch

但是遇到这个错误,

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - torchvision==0.3.0 -> python[version='>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=2.7

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. 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:

Output in format: Requested package -> Available versions

Package vs2008_runtime conflicts for:
python=2.7 -> vc=9 -> vs2008_runtime[version='>=9.0.30729.1,<10.0a0']
pytorch==1.1.0 -> ninja -> vs2008_runtime
python=2.7 -> vs2008_runtime

Package zlib conflicts for:
python=2.7 -> sqlite[version='>=3.30.1,<4.0a0'] -> zlib[version='>=1.2.11,<1.3.0a0']
torchvision==0.3.0 -> pillow[version='>=4.1.1'] -> zlib[version='1.2.*|1.2.11|1.2.11.*|>=1.2.11,<1.3.0a0|1.2.8']

我的特定 python 2.7 环境的 conda 列表是

# Name                    Version                   Build  Channel
ca-certificates           2021.1.19            haa95532_0
certifi                   2020.6.20          pyhd3eb1b0_3
pip                       19.3.1                   py27_0
python                    2.7.18               hfb89ab9_0
setuptools                44.0.0                   py27_0
sqlite                    3.30.1               h0c8e037_0
vc                        9                    h7299396_1
vs2008_runtime            9.00.30729.1         hfaea7d5_1
wheel                     0.36.2             pyhd3eb1b0_0
wincertstore              0.2              py27hf04cefb_0

我尝试将 sqlite 升级到 3.33.0 但它正在显示

已安装所有请求的软件包。

当我尝试卸载 sqlite 时,整个环境的 python 包都被卸载了。 请有人帮我解决这个问题。

【问题讨论】:

    标签: python-2.7 pytorch environment-variables conda torchvision


    【解决方案1】:

    PyTorch 从未为 Python 2.7 的这些版本的 PyTorch 和 TorchVision 构建 Windows。为此可以使用conda search

    $ conda search 'pytorch[channel=pytorch,subdir=win-64,version=1.1]'
    Loading channels: done
    # Name     Version    Build                     Channel             
    pytorch    1.1.0      py3.5_cuda100_cudnn7_1    pytorch             
    pytorch    1.1.0      py3.5_cuda90_cudnn7_1     pytorch             
    pytorch    1.1.0      py3.6_cuda100_cudnn7_1    pytorch             
    pytorch    1.1.0      py3.6_cuda90_cudnn7_1     pytorch             
    pytorch    1.1.0      py3.7_cuda100_cudnn7_1    pytorch             
    pytorch    1.1.0      py3.7_cuda90_cudnn7_1     pytorch   
    

    至少您必须使用 Python 3.5,但如果您要使用 Python 3 并需要那些特定的 PyTorch 版本,您不妨跳到 Python 3.7。

    conda create -n pytorch_1_1 -c pytorch python=3.7 pytorch=1.1 torchvision=0.3
    

    【讨论】:

    • 它可以在 Linux 机器上运行吗? python=3.7 pytorch=1.1 torchvision=0.3
    • 是的,3.7 和 2.7 都有针对 Linux 和 OS X 的 PyTorch 构建。只是他们似乎选择性地排除了 Windows。试试conda search 'pytorch[channel=pytorch,subdir=linux-64,version=1.1]'
    猜你喜欢
    • 2016-01-09
    • 1970-01-01
    • 2019-10-06
    • 1970-01-01
    • 2019-07-27
    • 1970-01-01
    • 1970-01-01
    • 2021-01-11
    • 2016-05-26
    相关资源
    最近更新 更多