openssl - Pip:安装 pip 时:“未找到安装的匹配发行版”SSL 错误
问题描述
- Pip 版本:未安装
- Python版本:2.7.0
- 操作系统:Windows 7 Ultimate 64 位
描述:
我正在尝试在 Python 2.7.0 上安装 pip。它必须在这个版本中,因为我想使用3Blue1Brown 的 manim。但是,当我尝试安装 pip 时收到此消息:
Could not find a version that satisfies the requirement install (from versions
: )
No matching distribution found for install
我跑了什么:
当我输入 python get-pip.py 时,我收到了这条消息
```
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/ins
tall/
c:\users\snake\appdata\local\temp\tmpbgk_ty\pip.zip\pip\_vendor\urllib3\util\ssl
_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. Th
is 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-us
age.html#ssl-warnings
Could not fetch URL https://pypi.org/simple/install/: There was a problem conf
irming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/install/ (Caused by SSLError(SSLError(1, '_ss
l.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol
version'),)) - skipping
Could not find a version that satisfies the requirement install (from versions
: )
No matching distribution found for install
```
我从这个网站下载了 OpenSSL ,当我输入
openssl version
cmd 时,我得到了这个:
OpenSSL 1.0.1f 6 Jan 2014
我认为OpenSSL 安装正确,但 Python 没有使用它(假设它应该使用它)。
解决方案
我发现 Python 已经通过 OpenSSL 运行
import ssl
print(ssl.OPENSSL_VERSION)
版本太旧了。而且,如果可能的话,一位用户告诉我更新其 OpenSSL 会非常复杂。因此,我所做的只是简单地下载 Python 2.7.15 并解决了。
推荐阅读
- powershell - Remove-PSDrive 不会删除映射的驱动器
- mysql - MySQL:从 A 到 B 的最短路径
- rascal - M3 Java:如何检查一个类是否从接口实现了一个函数
- haskell - Haskell 中的 NTLM 身份验证
- c# - 带有参数的 ASP.NET Core Razor 页面路由
- glue42 - 如何使窗口始终出现在指定位置?
- php - Explode() 函数未按预期工作
- reactjs - 使用钩子 React 进行切换时出现意外输出但预期视图
- asp.net-core - 在 asp.net 核心应用程序中将控制台输出捕获到 Azure ApplicationInsights
- html - 对于 iOS iFrame 修复,iFrame 和 Div ID 无法正常工作