当前位置: 移动技术网 > IT编程>脚本编程>Python > Python更改pip源

Python更改pip源

2019年10月03日  | 移动技术网IT编程  | 我要评论

蒙阴县,淘宝网项链,德国足球国家队

python更改pip源

pip源有以下

新版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/

 

windows下修改方式:

直接在user目录中创建一个pip目录,如:c:\users\xx\pip,新建文件pip.ini

文件内容为:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn

以清华源为例

 

linux下修改方式:

在用户家目录下的 .pip 目录下创建一个 pip.conf 文件 , 如果没有 .pip 目录自行创建。

mkdir ~/.pip

cd ~/.pip

touch pip.conf

#编辑pip.conf文件
sudo gedit ~/.pip/pip.conf

将以下文件复制到 pip.conf 内

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn

以清华源为例

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网