使用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
请帮助解决它。 点子版本是18.1 Python版本是3.7
答案 0 :(得分:2)
好吧,这是我始终会遵循的骇客方式,但每次都能奏效-我需要这样做,因为我的公司网络背后存在沉重的分层安全性。
每次您需要安装pip 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 --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
答案 1 :(得分:1)
It seems that for current release v1.0.2 Python 3.7 is not supported yet. Its support does exist in the master branch, but not yet released.
答案 2 :(得分:0)
您的“ f”应为“ F”:
pip install Flask