1、更換python源
mkdir ~/.pip cd ~/.pip vi pip.conf
vi編輯內容如下:
[global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple [install]
trusted-host=pypi.tuna.tsinghua.edu.cn disable-pip-version-check = true timeout = 6000 --------------------- 作者:ke1th 來源:CSDN 原文:https://blog.csdn.net/u012436149/article/details/66974668 版權聲明:本文為博主原創文章,轉載請附上博文鏈接!
上述內容中這一段是可選操作
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn disable-pip-version-check = true timeout = 6000
下面是python常用的國內鏡像
新版ubuntu要求使用https源,要注意。 清華:https://pypi.tuna.tsinghua.edu.cn/simple 阿里雲:http://mirrors.aliyun.com/pypi/simple/ 中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/ 華中科技大學:http://pypi.hustunique.com/ 山東理工大學:http://pypi.sdutlinux.org/ 豆瓣:http://pypi.douban.com/simple/ --------------------- 作者:木盞 來源:CSDN 原文:https://blog.csdn.net/leviopku/article/details/80113021 版權聲明:本文為博主原創文章,轉載請附上博文鏈接!
2、更換anaconda源
terminal中輸入下面語句,添加清華的鏡像源到anaconda配置文件中
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' conda config --set show_channel_urls yes
刪除anaconda中的鏡像源配置
conda config --remove channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
查看anaconda的鏡像配置
conda config --show
上述參考:https://blog.csdn.net/u012436149/article/details/66974668
參考2,點此處