Could not find a version that satisfies the requirement in python
Question:
I am trying to create virtual env with python2 in mac os from here.
While running pip install virtualenv
command in terminal I am getting following error.
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
Answers:
Run this command and try again
curl https://bootstrap.pypa.io/get-pip.py | python
The detailed description can be found in the link shared by Anupam in the comments.
If you are using python 3.x, Please try this commands
sudo pip3 install –upgrade pip
sudo pip3 install virtualenv
Please try below commands
pip install --upgrade virtualenv
We tried the above but they didn’t work in our case because we had two versions of python3 on the systems. One via a normal install a few months back and one via brew (on a Mac). When we discovered that, we downloaded and installed the latest version from python.org and as a result the pip was updated too. Once the pip was installed the sudo pip3 install virturaenv command worked fine.
If you are using Windows, you have to run cmd as admin.
pip install –upgrade virtualenv
This solution works for me in Centos8
Try Below commands:
pip install –upgrade pip
pip install <‘package-name’>
example: pip install locust_plugins
To check the list of packages installed, use below command:
pip list
I tried the same and it worked for me
It is sometimes because of connectivity issue. Re-running the same command when connectivity is okay solves it.
pip install virtualenv
Initial Output:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A91A94190>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922B3390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922B0850>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922C5990>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922C64D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
ERROR: Could not find a version that satisfies the requirement virtualenv (from versions: none)
ERROR: No matching distribution found for virtualenv
WARNING: There was an error checking the latest version of pip.
Output after re-run when connectivity is okay:
Collecting virtualenv
Using cached virtualenv-20.17.0-py3-none-any.whl (8.8 MB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/distlib/
Collecting distlib<1,>=0.3.6
Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.4.1
Using cached filelock-3.8.0-py3-none-any.whl (10 kB)
Collecting platformdirs<3,>=2.4
Using cached platformdirs-2.5.4-py3-none-any.whl (14 kB)
Installing collected packages: distlib, platformdirs, filelock, virtualenv
Successfully installed distlib-0.3.6 filelock-3.8.0 platformdirs-2.5.4 virtualenv-20.17.0
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
One of the important reasons for this problem is the lack of proper connection to the Internet. If you have this error to install other modules, try to make sure of your internet connection.
Note: If you use vpn, try to connect and disconnect it once, the problem may be with vpn.
I am trying to create virtual env with python2 in mac os from here.
While running pip install virtualenv
command in terminal I am getting following error.
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
Run this command and try again
curl https://bootstrap.pypa.io/get-pip.py | python
The detailed description can be found in the link shared by Anupam in the comments.
If you are using python 3.x, Please try this commands
sudo pip3 install –upgrade pip
sudo pip3 install virtualenv
Please try below commands
pip install --upgrade virtualenv
We tried the above but they didn’t work in our case because we had two versions of python3 on the systems. One via a normal install a few months back and one via brew (on a Mac). When we discovered that, we downloaded and installed the latest version from python.org and as a result the pip was updated too. Once the pip was installed the sudo pip3 install virturaenv command worked fine.
If you are using Windows, you have to run cmd as admin.
pip install –upgrade virtualenv
This solution works for me in Centos8
Try Below commands:
pip install –upgrade pip
pip install <‘package-name’>
example: pip install locust_plugins
To check the list of packages installed, use below command:
pip list
I tried the same and it worked for me
It is sometimes because of connectivity issue. Re-running the same command when connectivity is okay solves it.
pip install virtualenv
Initial Output:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A91A94190>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922B3390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922B0850>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922C5990>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000023A922C64D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
ERROR: Could not find a version that satisfies the requirement virtualenv (from versions: none)
ERROR: No matching distribution found for virtualenv
WARNING: There was an error checking the latest version of pip.
Output after re-run when connectivity is okay:
Collecting virtualenv
Using cached virtualenv-20.17.0-py3-none-any.whl (8.8 MB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/distlib/
Collecting distlib<1,>=0.3.6
Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.4.1
Using cached filelock-3.8.0-py3-none-any.whl (10 kB)
Collecting platformdirs<3,>=2.4
Using cached platformdirs-2.5.4-py3-none-any.whl (14 kB)
Installing collected packages: distlib, platformdirs, filelock, virtualenv
Successfully installed distlib-0.3.6 filelock-3.8.0 platformdirs-2.5.4 virtualenv-20.17.0
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
One of the important reasons for this problem is the lack of proper connection to the Internet. If you have this error to install other modules, try to make sure of your internet connection.
Note: If you use vpn, try to connect and disconnect it once, the problem may be with vpn.