I tried to use virtualenvwrapper to create a virtualenv with both python2 and python3
Per virtualenv with python2 and python3 via Homebrew I hoped this would work:
(The name of the virtualenv is 'double')
mkvirtualenv double -p `which python`
mkvirtualenv double -p `which python3`
It mentions that
Not overwriting existing python script both/bin/python (you must use both/bin/python3.4)
But it that does not seem to be true. Typing python
python2.7
python3
and python3.4
all start the python3.4
interpreter.
We can have both Python 2 and Python 3 installed on any Windows or Linux device. We can either create different environments on different IDEs to use the versions separately or use the following ways to run them using the command prompt.
It's still possible to use a different python version with venv . Instead of providing an argument, like with virtualenv , you just be sure to use the appropriate python version to run venv .
Found a workaround to use Spyder on python 2.7. setup two virtual environments for Python 2.7 and 3.6. Launce anaconda navigator and install spyder 3.3. 6 on both the environments Launch spyder on the environment with Python 3.6 Preferences-->Python Interpreter --> set the Python path for 2.7 Restart Spyder Done!
Sorry, virtualenv is designed to support single interpreter version.
If you need to use several python versions on the same codebase please create separate virtual environments.
virtualenv
does not support multiple interpreter versions . My suggestion is to use different environment for each of the versions :
virtualenv -p /usr/bin/python3.3 py3env
virtualenv -p /usr/bin/python py2env
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With