简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM