Could not find a version that satisfies the requir

2020-02-26 11:07发布

问题:

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

回答1:

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.



回答2:

If you are using python 3.x, Please try this commands

sudo pip3 install --upgrade pip

sudo pip3 install virtualenv



回答3:

Please try below commands

pip install --upgrade virtualenv


回答4:

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.



回答5:

If you are using Windows, you have to run cmd as admin.