使用conda安装pytorch-gup环境报错解决

使用conda安装pytorch:

(pytorch) C:\Users\Gasto>conda install pytorch torchvision torchaudio cudatoolkit=11.6

出现如下报错:

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

解决方法:

1.添加镜像源

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/

2.运行如下命令

conda config --append channels conda-forge

3.重新运行pytorch安装命令

conda install pytorch torchvision torchaudio cudatoolkit=11.6

你可能感兴趣的:(环境配置,pytorch,conda,深度学习)