【pytorch-环境及源布置】

在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()

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值