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

Tried installing PyTorch with pip but got these errors:

(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 version:

(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 Version:

(pgqa) raphy@pc:~$ python --version
Python 3.10.0

Why does it asks for python3.1 if the latest stable python version is 3.10 ? How to solve the problem?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Raphael10
  • 2,508
  • 7
  • 22
  • 50

2 Answers2

3

Conda 4.10 is incompatible with python 3.10.

The reason you cannot install many packages with conda is that conda 4.10 has a known bug handling python 3.10. Update your conda to 4.11 or revert your python to 3.9 or older. Read more here in this SO answer.

As a workaround, you can still try to use pip.

DanielTuzes
  • 2,494
  • 24
  • 40
1

Have you tried upgrading your pip?
It works with following commands and versions:

$ 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

enter image description here

jdsurya
  • 1,326
  • 8
  • 16
  • `(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 . `Are you suggesting me to downgrade both python and pip ? – Raphael10 Nov 29 '21 at 13:32
  • Hi @Raphael10, I have tried with pip 21.3.1 and python 3.8 and it works fine. At this stage I am not able to confirm the same for python 3.10.0 – jdsurya Nov 29 '21 at 14:00
  • Yes. It seems that the problem is with `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 https://download.pytorch.org/whl/cpu/torch_stable.html Looking in links: https://download.pytorch.org/whl/cpu/torch_stable.html Collecting torch==1.10.0+cpu Downloading https://download.pytorch.org/whl/cpu/torch-1.10.0%2Bcpu-cp38-cp38-linux – Raphael10 Nov 29 '21 at 14:09
  • https://github.com/pytorch/pytorch/issues/67669 I guess 3.10 is not supported yet, – Umang Gupta Nov 29 '21 at 20:48