Pycharm由于SSL无法安装软件包

时间:2018-12-18 11:14:19

标签: python ssl pycharm

我正在使用Windows 7虚拟机,但是无法添加ctypes。 我的物理机运行Ubuntu,互联网连接是一个WiFi热点。

发生错误:

  

无法获取网址https://pypi.org/simple/ctypes/:存在一个   确认ssl证书时出现问题:   HTTPSConnectionPool(host ='pypi.org',port = 443):超过最大重试次数   网址:/ simple / ctypes /(由SSLError(SSLError(1,'_ssl.c:499:   错误:1407742E:SSL例程:SSL23_GET_SERVER_HELLO:tlsv1警报   协议版本'),))-跳过

命令输出:

  

收集ctypes无法获取URL   https://pypi.org/simple/ctypes/:确认   ssl证书:HTTPSConnectionPool(host ='pypi.org',port = 443):最大值   网址超出了重试次数:/ simple / ctypes /(由   SSLError(SSLError(1,'_ssl.c:499:错误:1407742E:SSL   例程:SSL23_GET_SERVER_HELLO:tlsv1警报协议版本'),))-   正在跳过无法获取URL https://pypi.org/simple/pip/:存在一个   确认ssl证书时出现问题:   HTTPSConnectionPool(host ='pypi.org',port = 443):超过最大重试次数   网址:/ simple / pip /(由SSLError(SSLError(1,'_ssl.c:499:   错误:1407742E:SSL例程:SSL23_GET_SERVER_HELLO:tlsv1警报   协议版本'),))-跳过

C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. 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
  SNIMissingWarning
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  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/ctypes/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=3, 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/ctypes/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=2, 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/ctypes/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=1, 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/ctypes/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=0, 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/ctypes/
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Could not find a version that satisfies the requirement ctypes (from versions: )
No matching distribution found for ctypes
C:\Python27\lib\site-packages\pip-10.0.1-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:137: 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

1 个答案:

答案 0 :(得分:0)

尝试升级您的urllib安全软件包,例如通过点子。

pip install urllib3[secure]

这应该指导您: https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2

您的urllib似乎尝试使用tlsv1访问pypi。 很可能他们不再允许您了。

使您的工具链保持最新状态,您应该会很好。

更新:

如何在不同版本的Windows上使用pip做事,已经在这里解答:How do I install pip on Windows?