PIP國內的一些鏡像源和配置多pip源的方法


 

 

PIP國內的一些鏡像源
-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
下載時可以指定源:
pip install --pre  uiautomator2  -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
 
pip install --pre  websocket-client -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
uiautomator2為要下載的文件名 需要下載什么就改成什么
-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
 
 
或者配置pip.conf配置文件,配置多個源,
 
服務器為linux系統(win10也可用)
在牆內使用pip總會遇到一些問題,ti子經常會
掛掉,更換國內的源或許更合適,如清華源、中科大源、豆瓣源、阿里源等。
大致配置如下:

[global]
timeout=40
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
extra-index-url=
        http://mirrors.aliyun.com/pypi/simple/
        http://pypi.douban.com/simple
        http://pypi.mirrors.ustc.edu.cn/simple/

[install]
trusted-host=
        pypi.tuna.tsinghua.edu.cn
        mirrors.aliyun.com
        pypi.douban.com
        pypi.mirrors.ustc.edu.cn
       
以下按需要添加,trusted-host是可信主機的意思
proxy_servers:
  http: http://xxx.xxx.x.xx:8080
  https: https://xxx.xxx.x.xx:8080
ssl_verify: false
————————————————
版權聲明:本文為CSDN博主「Jonah_Mao」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/Mao_Jonah/article/details/110558964
 
 
pip卸載
pip uninstall django
安裝opencv
pip install opencv-contrib-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip install airtest -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip install airtest_selenium -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com


免責聲明!

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



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