PyTorch 安装要求 python=3.1 。安装的 Python 版本:3.10.0
Posted
技术标签:
【中文标题】PyTorch 安装要求 python=3.1 。安装的 Python 版本:3.10.0【英文标题】:PyTorch installation asks for python=3.1 . Python Version installed: 3.10.0 [duplicate] 【发布时间】:2022-01-06 07:01:20 【问题描述】:(pgqa) raphy@pc:~/pythonMatters/PathGenerator$ conda install pytorch torchvision torchaudio cpuonly -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.1
Current channels:
- https://conda.anaconda.org/pytorch/linux-64
- https://conda.anaconda.org/pytorch/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
(pgqa) raphy@pc:~/pythonMatters/PathGenerator$ python3 --version
Python 3.10.0
尝试使用 pip 安装 PyTorch,但出现以下错误:
(pgqa) raphy@pc:~/pythonMatters/PathGenerator$ pip3 install torch==1.10.0+cpu
torchvision==0.11.1+cpu torchaudio==0.10.0+cpu -f https://download.pytorch.org
/whl/cpu/torch_stable.html
Looking in links: https://download.pytorch.org/whl/cpu/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cpu (from versions: none)
ERROR: No matching distribution found for torch==1.10.0+cpu
操作系统:Ubuntu 20.04
pip 版本:
(pgqa) raphy@pc:~$ pip --version
pip 21.2.4 from /home/raphy/anaconda3/envs/pgqa/lib/python3.10/site-packages/pip (python 3.10)
(pgqa) raphy@pc:~$ pip3 --version
pip 21.2.4 from /home/raphy/anaconda3/envs/pgqa/lib/python3.10/site-packages/pip (python 3.10)
Python 版本:
(pgqa) raphy@pc:~$ python --version
Python 3.10.0
如果最新的稳定python版本是3.10,为什么它要求python3.1? 如何解决问题?
【问题讨论】:
【参考方案1】:您是否尝试过升级您的pip
?
它适用于以下命令和版本:
$ python --version
Python 3.8.10
$ pip --version
pip 21.3.1
$ pip install torch==1.10.0+cpu torchvision==0.11.1+cpu torchaudio==0.10.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
【讨论】:
(pgqa) raphy@pc:~$ pip --version pip 21.2.4 from /home/raphy/anaconda3/envs/pgqa/lib/python3.10/site-packages/pip (python 3.10) (pgqa) raphy@pc:~$ pip3 --version pip 21.2.4 from /home/raphy/anaconda3/envs/pgqa/lib/python3.10/site-packages/pip (python 3.10) (pgqa) raphy@pc:~$ python --version Python 3.10.0 .
你是在建议我同时降级 python 和 pip 吗?
嗨@Raphael10,我已经尝试过使用 pip 21.3.1 和 python 3.8 并且效果很好。在这个阶段,我无法确认 python 3.10.0
是的。似乎问题出在python 3.10.0
: (pgqa) raphy@pc:~$ python --version Python 3.8.10 (pgqa) raphy@pc:~$ pip --version pip 21.1.1 from /home/raphy /anaconda3/envs/pgqa/lib/python3.8/site-packages/pip (python 3.8) (pgqa) raphy@pc:~$ pip3 install torch==1.10.0+cpu torchvision==0.11.1+cpu torchaudio ==0.10.0+cpu -f download.pytorch.org/whl/cpu/torch_stable.html查看链接:download.pytorch.org/whl/cpu/torch_stable.html收集火炬==1.10.0+cpu下载download.pytorch.org/whl/cpu/torch-1.10.0%2Bcpu-cp38-cp38-linux
github.com/pytorch/pytorch/issues/67669 估计3.10还不支持,以上是关于PyTorch 安装要求 python=3.1 。安装的 Python 版本:3.10.0的主要内容,如果未能解决你的问题,请参考以下文章
markdown 如何在RaspberryPi 3B上安装PyTorch v0.3.1 - 教程