Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PackagesNotFoundError: cudatoolkit=11.1.0 when installing pytorch

Tags:

conda

anaconda

I get the installation command from the https://pytorch.org/get-started/locally/. When I run the command: conda install pytorch torchvision torchaudio cudatoolkit=11.1.0 -c pytorch I get the following error:

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:

  - cudatoolkit=11.1.0

Current channels: like

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

Then I have tried the following commands one by one:

(base) eslam@scholar:~$ conda config --append channels conda-forge
(base) eslam@scholar:~$ install cudatoolkit=11.1.0
install: missing destination file operand after 'cudatoolkit=11.1.0'
Try 'install --help' for more information.
(base) eslam@scholar:~$ conda install -c conda-forge cudatoolkit=11.1.0

Get the same output as above.

(base) eslam@scholar:~$ conda info --envs
# conda environments:
#
base                  *  /home/eslam/anaconda3

How can I fix this problem, please?

like image 385
eslam fouda Avatar asked Oct 29 '20 10:10

eslam fouda


3 Answers

you need to use -c conda-forge for newest installs. From official site the command is:

conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge

https://pytorch.org

like image 108
Ivan Zhuk Avatar answered Mar 14 '23 20:03

Ivan Zhuk


This worked for me: conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge

like image 28
ady Avatar answered Mar 14 '23 21:03

ady


You can search cudatoolkit in anaconda.org and find the channel that has your arch and version. In my case, I was installing PyTorch 1.8.1 under Windows but apparently the nvidia channel mentioned on the front page of PyTorch doesn't contain any packages for Windows, so I had to switch to conda-forge, where cudatoolkit 11.1 can be found (e.g., from the search result above).

like image 45
ziyuang Avatar answered Mar 14 '23 21:03

ziyuang