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
posted @ 2021-03-14 10:23  范若若  阅读(1400)  评论(0编辑  收藏  举报