使用pip安装包时出现异常。我试着安装了numpy,flask和其他软件。但是得到了低于错误。
C:\Users\ABC>pip install flask
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0667CB50>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0667C190>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0667C7F0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0667C8F0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0667C0F0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
请帮助解决它。Pip版本为18.1 Python版本为3.7
发布于 2019-03-06 19:17:16
好吧,这是一个我总是遵循的黑客,但每次都有效-我需要这样做,因为我的公司网络背后是沉重的分层安全。
每次您需要安装pkgs时,请预先从cmd运行以下命令(您不需要是管理员):
set http_proxy=http://your_corp_username:password@<your_corp_proxy_host>:<port>
set https_proxy=https://your_corp_username:password@<your_corp_proxy_host>:<port>
然后运行您常用的pip命令。
如果pip抛出一些SSL信任/解析错误。您还可以执行以下操作来通过您的网络信任pip:
pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org install <some_package>
使用以下命令仅在当前用户下安装软件包(这不需要管理员权限)
pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org install <some_package> --user
发布于 2019-03-06 19:25:10
你的"f“应该是"F":
pip install Flask
发布于 2019-03-06 19:34:18
似乎对于当前发布的v1.0.2 Python3.7 is not supported yet。它的支持确实存在于master branch中,但尚未发布。
https://stackoverflow.com/questions/55021270
复制相似问题