Could not fetch URL https://pypi.python.org/simple/pymysql/: There was a problem confirming the ssl

时间:2024-03-18 20:14:35

Collecting pymysql
Cache entry deserialization failed, entry ignored
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’
),)’: /simple/pymysql/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’
),)’: /simple/pymysql/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’
),)’: /simple/pymysql/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’
),)’: /simple/pymysql/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’
),)’: /simple/pymysql/
Could not fetch URL https://pypi.python.org/simple/pymysql/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/p
ymysql/ (Caused by SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)’),)) - skipping
Could not find a version that satisfies the requirement pymysql (from versions: )
No matching distribution found for pymysql
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the ‘python -m pip install --upgrade pip’ command.

以上是我在安装pypi的时候报错,主要是因为SSL认证问题。然后我网查了很多资料,都是讲述了pip版本或者源问题。
用了一个方法“sudo pip --trusted-host pypi.python.org install pylint”执行安装依赖,发现这个只是暂时性解决问题的方法(来源:https://blog.csdn.net/weixin_43851030/article/details/84618651)
然后我换了豆瓣的代理源,又提示了“ImportError: No module named ‘pip’”

最后奇迹出现了,我关掉了fiddler抓包工具,然后就没问题了,重复试验fiddler和其他抓包工具,确定是抓包工具会影响python 的pip install的SSL安全认证问题,只要把抓包工具关闭了就没问题了,至于根源原因,我是个小白也不太懂。

Could not fetch URL https://pypi.python.org/simple/pymysql/: There was a problem confirming the ssl