0

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.

1

1 Answer 1

2

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.

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

1 Comment

Hi Burhan, I posted a related question in another post, stackoverflow.com/questions/43334455/… which includes the information of my python development environment. Based on which, it seems that I do not have python 2.7, then how should I do?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.