pip 源 替换国内源

网上收集来的pip源地址:

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
豆瓣(douban) http://pypi.douban.com/simple/ 
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

setuptools 工具

function:安装pip工具的前置依赖

https://pypi.org/project/setuptools/#files

python setup.py install

pip 工具:(需要先安装setuptools工具)

function:支持大部分python模块的安装

https://pypi.org/project/pip/#files

python setup.py install

wheel工具:(需要先安装pip工具)

function: 支持.whl后缀文件安装

pip install wheel    

Tips:一个推荐的whl模块下载网站

https://www.lfd.uci.edu/~gohlke/pythonlibs/

临时使用三方源的方式:(命令版)

 pip install <模块名> -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

永久使用三方源的方式:(修改文件版)

Linux版本修改pip源使用国内源:

 ~/.pip/pip.conf(如果没有就自行创建)

Windows版本修改pip源使用国内源:

%HOMEPATH%\pip\pip.ini

修改配置文件内容:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com  # 如果不添加这两行,将会出现如下错误提示:

  

参考资料:

https://blog.csdn.net/chenghuikai/article/details/55258957

https://www.cnblogs.com/sunnydou/p/5801760.html

猜你喜欢

转载自www.cnblogs.com/Cong0ks/p/9131903.html