python库从国内镜像地址进行安装(非常实用的,亲测很好用)

偶尔善良 提交于 2020-01-20 10:11:28

(1)使用python内置的pip安装库:

国内镜像地址:https://pypi.tuna.tsinghua.edu.cn/simple

例如:安装 tensorflow可以使用如下命令

pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple(所有的库只要在这里改个tensorflow 名字就行啦,替换成我们要的库名称即可,速度真的超快的)
这样的话,安装速度飞起

(2)基于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
然后在运行安装库的命令

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!