anaconda换清华源
目的:pytorch下载过慢而换源
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
附:
查看镜像源命令:conda config --show channels
移除镜像源命令:conda config --remove-key channels
下载pytorch
进入pytorch官网,点击get started后复制如下代码,去除后缀 -c pytorch,否则仍会寻找pytorch官网源下载:
conda install pytorch torchvision torchaudio cudatoolkit=10.2
pip换源
加入后缀i命令。
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
本文介绍如何将Anaconda的源更换为清华大学的镜像源,以加速PyTorch等库的下载速度。同时提供了查看、移除镜像源及使用pip安装库的指令。
805

被折叠的 条评论
为什么被折叠?



