Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

python - Could not find a version that satisfies the requirement flask (from versions: ) No matching distribution found for flask

Exception occurs while installing package using pip. I tried installing numpy, flask and others. but getting below error.

C:UsersABC>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

Please help resolving it. Pip version is 18.1 Python version is 3.7

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Okay, this is a hack that I always follow but works every time - I need to because my corp net is behind heavy layered security.

Every time you need to install pip pkgs, run the following commands beforehand from your cmd (you don't need to be Admin):

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>

Then run your usual pip commands.

If pip throws some SSL trust/resolution error. You can also do the following to trust pip by your network:

pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org install <some_package>

Use the following for installing packages under current user only (this doesn't require Admin privileges)

pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org install <some_package>  --user

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...