Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

pip

An exception occurs while installing a package using pip. I tried installing NumPy, Flask and others, but I am getting the below error.

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

How can I resolve it?

The pip version is 18.1, and the Python version is 3.7.

like image 534
Deep Avatar asked Mar 06 '19 10:03

Deep


People also ask

Could not find a version that satisfies the requirement flask SQLAlchemy from versions none?

The error "Could not find a version that satisfies the requirement SQLAlchemy" occurs for multiple reasons: Installing SQLAlchemy using a Python version that is not supported by the package. Having an outdated version of pip or using pip for Python 2 instead of pip3 . Misspelling the name of the module.

Could not find a version that satisfies the requirement click?

The error "Could not find a version that satisfies the requirement" is often caused due to not having the necessary permissions to install a package for all users on the machine. To solve the error, install the package scoped to the specific user with the --user option. Copied!


1 Answers

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

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

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 the current user only (this doesn't require administrator privileges)

pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org install <some_package>  --user
like image 143
systrigger Avatar answered Sep 27 '22 20:09

systrigger