[技术技巧]PyCharm 添加第三方PIP源的两个问题及解决方案


上一篇文章讲了如何在新版的PyCharm中添加第三方PIP源,但是添加以后阿里云的源以后又再遇到了两个问题

因为链接不是ssl而报错

错误提示如下:

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'. Could not find a version that satisfies the requirement proxy (from versions: ) No matching distribution found for proxy

解决方案:使用https链接

http://mirrors.aliyun.com/pypi/simple/
改成
https://mirrors.aliyun.com/pypi/simple/

因为科学上网而报错

错误提示如下:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)': /simple/pandas/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)': /simple/pandas/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)': /simple/pandas/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)': /simple/pandas/

这个问题搜索了好久终于找到了原因,有大神说就是因为启用了科学上网工具,必须关闭以后才能解决问题,即便是direct模式都不可以。

解决方案:关闭科学上网工具

也有大神提示说是urllib新版本的原因,直接退回urllib老版本1.23可以解决这个问题

pip3 install urllib3==1.23

就这样,两个奇奇怪怪的问题就解决了。

声明:Sawyer's Blog|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - [技术技巧]PyCharm 添加第三方PIP源的两个问题及解决方案


Sawyer Cheung的杂记博客