python安装第三方库---更改镜像源
更换anaconda源
清华大学镜像:清华大学镜像
更换仓库镜像源命令:
conda config-- add channels 3359 mirrors.tuna.Tsinghua.edu.cn/anaconda/pkgs/free /
conda config-- add channels 3359 mirrors.tuna.Tsinghua.edu.cn/anaconda/pkgs/main /
conda config-- set show _ channel _ URLs是
2 .更换pip源
在python安装目录的暴躁裙子目录下运行命令:
cd ~/.pip
如果文件夹不存在:
mkdir ~/.pip
cd ~/.pip
touch pip.conf
vim pip.conf
在pip.conf中添加以下内容:
[global]
索引- URL=http://mirrors.a liyun.com/pypi/simple /
[install]
trusted-host=mirrors.a liyun.com
pip镜像源被保存。
下载pytorch0.4.0的示例
sudopipinstalltorch==0.4.0- f https://download.py torch.org/whl/cu90/stable
运行上述命令可以快速下载pytorch0.4.0
参考博客: