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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM