Running the following:
virtualenv -p python3 venv
gives:
Running virtualenv with interpreter /usr/bin/python3
Using base prefi
1.Check your internet connections.
2.Set python3 as your default python interpreter since you have python2.7 as your default python interpreter. Try using without any wheel by:
virtualenv venv --no-wheel
Then activate virtualenv and run:-
pip install --upgrade pip
pip install setuptools --no-use-wheel --upgrade
pip install wheel --no-cache
If you are behind proxy then use:-
sudo pip download setuptools pip wheel --proxy http://
After all this virtualenv -p python3 venv
is working in my virtualenv perfectly.
NOTE: Assuming virtual environment is already set in your system and python3 is your default interpreter.
Alternatively, you don't need to do
virtualenv -p python3 venv
. You can specify python interpreter(present in /usr/bin/* folder) which you want to use in virtualenv and use it like this:-
virtualenv --python=/usr/bin/pythonX.Y /home/username/path/to/virtualenv_nameif you want to install in the current working directory then you can use:-
virtualenv --python=/usr/bin/pythonX.Y virtualenv_name
REFERENCE