0
votes

I currently have Python 2.7 and 3.6 installed locally. I installed virtualenv and virtualenvwrapper with pip3. When I do not specify the the python version (i.e. $ mkvirtualenv hello) everything goes smoothly and I get the following output:

"Using base prefix '/home/rishi_gurnani/python' New python executable in /home/rishi_gurnani/.virtualenvs/hello/bin/python3.6 Also creating executable in /home/rishi_gurnani/.virtualenvs/hello/bin/python Installing setuptools, pip, wheel...done. virtualenvwrapper.user_scripts creating /home/rishi_gurnani/.virtualenvs/hello/bin/predeactivate virtualenvwrapper.user_scripts creating /home/rishi_gurnani/.virtualenvs/hello/bin/postdeactivate virtualenvwrapper.user_scripts creating /home/rishi_gurnani/.virtualenvs/hello/bin/preactivate virtualenvwrapper.user_scripts creating /home/rishi_gurnani/.virtualenvs/hello/bin/postactivate virtualenvwrapper.user_scripts creating /home/rishi_gurnani/.virtualenvs/hello/bin/get_env_details"

However, when I specify that I want python2.7 (i.e. $ mkvirtualenv -p python2.7 hello2) I get:

"Running virtualenv with interpreter /home/rishi_gurnani/python/bin/python2.7"

So no virtualenv is being created anywhere. In other words, I'm only able to create a virtualenv with Python 3.6. but I would also like to create one which uses 2.7 instead.

1
So what is your question exactly? - mentallurg
@mentallurg virtualenv supports the ability to create environments which use different versions of python. Why am I not able to do that? - rgurnani

1 Answers

0
votes

A question like yours has already been asked. You would want to refer to this: Can't Find or create a new virtualenv

Make sure that your virtualenv version installed is the one suitable for Python 2.7. As far as I know pip3 is only for Python3.