python - Pycharm 由于 SSL 安装包失败
问题描述
我正在使用 Windows 7 虚拟机,但无法添加 ctypes。我的物理机运行 Ubuntu,互联网连接是 WiFi 热点。
发生了错误:
无法获取 URL https://pypi.org/simple/ctypes/:确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org', port=443):最大重试次数超过 url:/simple/ ctypes/ (由 SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version')) - 跳过
命令输出:
收集 ctypes 无法获取 URL https://pypi.org/simple/ctypes/:确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: / simple/ctypes/(由 SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version') 引起) - 跳过无法获取 URL https://pypi。 org/simple/pip/ : 确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (由 SSLError(SSLError(1 , '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - 跳过
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
解决方案
尝试升级您的 urllib 安全包,例如通过 pip。
pip install urllib3[secure]
这应该可以指导您: https ://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
您的 urllib 似乎尝试使用 tlsv1 访问 pypi。他们很可能不再允许您这样做。
让你的工具链保持最新,你应该没问题。
更新:
如何在不同版本的 Windows 上使用 pip 进行操作已在此处得到解答:如何在 Windows 上安装 pip?
推荐阅读
- swift - 部分中选定行的索引
- azure-ad-b2c - Azure AD B2C - 身份框架体验时间表
- python - 在 Python 中使用方法链进行延迟计算
- c# - 如何从方法返回对对象的 const 引用?
- libc - 为什么 libc 有两个版本号(在 Ubuntu 上)?
- mongodb - Informatica 监视器和 mongodb 集合显示的加载记录数不匹配
- sql - 自联接与自然联接
- angular - Angular 未正确加载服务:“TypeError:无法读取未定义的属性‘注销’”
- python - 导入并运行文件夹中的所有模块
- c# - 获取对数据库的请求以错误结束的行号