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