PyTorch 安装要求 python=3.1 。 Python 安装的版本:3.10.0

PyTorch installation asks for python=3.1 . Python Version installed: 3.10.0

(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

O.S.: 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? 如何解决问题?

您是否尝试过升级 pip
它适用于以下命令和版本:

$python--版本

 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

Conda 4.10 与 python 3.10 不兼容。

你不能用 conda 安装很多包的原因是 conda 4.10 有一个已知的错误处理 python 3.10。将您的 conda 更新到 4.11 或将您的 python 恢复到 3.9 或更早版本。 Read more here in this SO answer.

作为解决方法,您仍然可以尝试使用 pip。