0

Is it possible to create a virtualenv with multiple versions of python?

This would allow the user to pip install both python3 and python2 packages (using pip2 and pip3).

The following doesn't work

virtualenv -p python2.7 -p python3.5 venv

1 Answer 1

1

virtualenv does not provide creating virtual environments with multiple versions of Python.

You can setup virtual environment for one interpreter only and -p takes only one argument that can be 'python3' or 'python2.7'.

The Python interpreter to use, e.g., –python=python2.5 will use the python2.5 interpreter to create the new environment. The default is the interpreter that virtualenv was installed with (like /usr/bin/python)

Source: Docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.