安装pyqt的时候,命令行如下:pip install pyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
出现错误如下:
C:\Users\86135>pip install pyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/pyqt5/
ERROR: Could not find a version that satisfies the requirement pyQt5 (from versions: none)
ERROR: No matching distribution found for pyQt5
WARNING: There was an error checking the latest version of pip.
截图如下:
pip源连接证书失败,看看代理、源镜像等是否正确
一般情况有如下几种:
对应解决方式一个个排错,各选其一
如果开了全局代理模式,则将其关闭即可
博主是开了全局模式,对应将其关闭就可下载
最后下载成功截图:
配置所需的源镜像,比如清华源、豆瓣源等
-i url路径
):pip install pyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
其他的源镜像还有如下:
镜像源 | 地址 |
---|---|
阿里云 | http://mirrors.aliyun.com/pypi/simple/ |
清华 | https://pypi.tuna.tsinghua.edu.cn/simple/ |
豆瓣 | http://pypi.douban.com/simple/ |
中国科技大学 | http://pypi.mirrors.ustc.edu.cn/simple/ |
中国科学技术大学 | http://pypi.mirrors.ustc.edu.cn/simple/ |
如果加了还不行,出现如下错误:
WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored.
If this repository is available via HTTPS we recommend you use HTTPS instead,
otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.
对应加上后缀 即可:
具体如下:
pip install pyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host https://pypi.tuna.tsinghua.edu.cn/simple
Win:(如若没有,对应进行创建 添加,主要为了后续好维护;若有则追加即可)
C:\Users\用户名\AppData\Roaming
增加一个pip文件夹[global]
index-url = http://mirrors.aliyun.com/pypi/simple # 指定下载源
trusted-host = mirrors.aliyun.com # 指定域名
Linux:具体配置文件路径,~/.pip/pip.conf
(没有则添加一个)
[global]
timeout = 10 # 搜索超时时长
index-url = http://mirrors.aliyun.com/pypi/simple/ # 优先第一搜索源
extra-index-url= http://pypi.douban.com/simple/ # 第二搜索源
[install]
trusted-host=
mirrors.aliyun.com
pypi.douban.com
docker出现如下问题,只需要重启docker即可,本身被停止了工作
原先在docker 加上DNS、断开VPN等好像不管用
方案一:重启防火墙
$firewall-cmd --permanent --zone=trusted --add-interface=docker0
$firewall-cmd --reload
方案二:重启docker
sudo systemctl restart docker
对应 还有其他bug 或者 其他方式解决 可底下评论