在cmd中输入 :conda --version,——查看是否有conda环境? (检验安装成功的标志)
在cmd中输入: conda info,——查看是否有? (检验安装成功的标志)
清华conda源地址:https://mirrors.tuna.tsinghua.edu.cn
添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
添加中科大源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes
查看现在添加的源
conda config --show-source
创建python环境
创建名为pytorch,python=3.9
的环境
conda create -n pytorch python=3.9
删除名为pytorch的python环境
conda remove -n pytorch --all
退出环境
deactivate pytorch
查看环境
conda info -e
查看该环境的python版本
python --version
查看这个环境下安装的包
conda list
验证cuda是不是可以正常运行
torch.cuda.is_available()