确认ssl证书的问题:HTTPSConnectionPool(host ='pypi.org',port = 443):

时间:2019-09-10 10:48:06

标签: python-2.7

所以我将 Pycharm 2019.2 Python 2.7 结合使用  而且我无法下载任何软件包。

我尝试过:

  • 将软件包硬拷贝到Python2.7目录
  • pip install urllib3 [安全]
  • pip install --trusted-host = pypi.python.org --trusted-host = pypi.org --trusted-host = files.pythonhosted.org xlrd

所有人都拒绝出现以下错误:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/xlrd/
C:\Python27\lib\site-packages\pip-19.0.3-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning

在Pycharm中,尝试安装软件包时出现以下错误:

Could not fetch URL https://pypi.org/simple/geopy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/geopy/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping

Proposed Solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python27\python.exe'.

使用python 3.4,但一切正常,但只有2.7,我遇到SSL错误。
     由于工作场所的技术原因,我无法更改为3.4。

1 个答案:

答案 0 :(得分:0)

这是一个口译员的问题。该代码最初是使用python 3.7编写的