解决pip install 速度慢问题

在Anaconda Prompt中运行pip install速度慢,可以修改为国内源,
注意新版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/

临时使用:
可以在使用pip的时候加参数 -i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。

例如:安装tensorflow方法:pip install --upgrade --ignore-installed tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple

conda install 安装慢
TUNA 还提供了 Anaconda 仓库的镜像,运行以下命令:
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
即可添加 Anaconda Python 免费仓库。
直接粘贴复制以上代码即可。另外,要一行一行运行,并且每一行运行完没有任何结果,直接运行下一行即可。
三行代码运行完,可以运行 conda install numpy 测试一下吧。

或者更改包的下载镜像通道,打开dos命令窗口,然后输入如下命令:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐