python 安装包时出现WARNING: Retrying 错误

通过 pip install 安装某模块时出现如下错误

python 安装包时出现WARNING: Retrying 错误
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('_ssl.c:980: The handshake operation timed out'))': /simple/prettytable/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('_ssl.c:980: The handshake operation timed out'))': /simple/prettytable/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('_ssl.c:980: The handshake operation timed out'))': /simple/prettytable/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', TimeoutError('_ssl.c:980: The handshake operation timed out'))': /simple/prettytable/

这是默认的python pip源的问题,这里使用国内镜像替换默认的即可解决。

附上国内的一些python 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/

使用方法:在后面直接 -i 加 url

pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/

如运行后 还是出现错误

python 安装包时出现WARNING: Retrying 错误
WARNING: The repository located at mirrors.aliyun.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 mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement prettytable (from versions: none)
ERROR: No matching distribution found for prettytable

在后面加上 –trusted-host mirrors.aliyun.com 即可

pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

网络信息,由52VPS整理收集,如若转载,请注明出处:https://www.52vps.com/1059.html

(2)
上一篇 2022-04-05 18:01
下一篇 2022-04-19 08:35

相关推荐