Pip无法在Windows上访问端口443,但浏览器可以

问题描述 投票:0回答:1

我的机构运行一个过滤器,使不太安全的网站无法访问。我可以使用浏览器轻松访问的一个网站是

https://pypi.python.org/simple/waitress/

然而,如果我从Anaconda命令提示符运行pip -vvv install waitress(问题出现在所有包中,而不仅仅是女服务员),我得到:

Could not fetch URL https://pypi.python.org/simple/waitress/:
connection error: HTTPSConnectionPool(host='pypi.python.org', port=443):
Max retries exceeded with url: /simple/waitress/ (Caused by
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection
object at 0x00000000050FD400>:
Failed to establish a new connection: [WinError 10061]
No connection could be made because the target machine
actively refused it',)) - skipping

我可以请求有选择地打开必要的URL,但在这种情况下,pypi.python.org的端口443似乎已经打开。

你能解释一下这个难题吗?为什么pip无法访问浏览器(在同一台机器上)可以访问的网站?

python windows filter pip
1个回答
0
投票

这是一个使用ssl的简单解决方案,因为pip 10.0的发布,你应该能够通过升级pip本身来永久修复它:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip waitress

如果有效,请告诉我

© www.soinside.com 2019 - 2024. All rights reserved.