1
(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

点子版本:

(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 版本是 3.10 ,为什么它要求 python3.1 ?如何解决问题?

4

2 回答 2

1

你试过升级你的pip吗?
它适用于以下命令和版本:

$蟒蛇--版本

 Python 3.8.10

$点子--版本

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

在此处输入图像描述

于 2021-11-29T13:13:14.237 回答
1

Conda 4.10 与 python 3.10 不兼容。

您无法使用 conda 安装许多软件包的原因是 conda 4.10 具有处理 python 3.10 的已知错误。将您的 conda 更新到 4.11 或将您的 python 恢复到 3.9 或更早版本。在这个 SO 答案中阅读更多信息。

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

于 2022-01-28T19:37:44.450 回答