user288609
user288609

Reputation: 13065

creating a virtual environment to support Python 2.7

I have a python development environment supporting Python 3.4.5. Right now, I would like to create a virtual environment using vritualenv. In this virtual environment, I need to support Python 2.7 instead since some of to-be-used Python programs only work for Python 2.7. How to create this virtual environment. Thanks.

Upvotes: 0

Views: 560

Answers (1)

Burhan Khalid
Burhan Khalid

Reputation: 174748

If you already have Python 2.7 installed, then you can pass an argument to virtualenv to use a different Python version, like this:

virtualenv --python=python py27env

Note that is it practice that python points to python 2.x, whereas python3 points to python 3.x - if your system layout is different, adjust the command appropriately.

Upvotes: 2

Related Questions