Jian
Jian

Reputation: 11060

create a virtualenv with multiple versions of python

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

Upvotes: 0

Views: 365

Answers (1)

Vaibhav Mule
Vaibhav Mule

Reputation: 5126

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

Upvotes: 1

Related Questions