简体   繁体   中英

virtualenv with python2 and python3 via Homebrew

I have installed python2 and python3 with Homebrew. I would like to use virtualenv but I am not sure if I need to install it for both python2/python3. I am also wondering if I use virtualenvwrapper can I just set the VIRTUALENVWRAPPER_PYTHON to be either python2 or python3 depending on my needs?

Any help is greatly appreciated.

Thanks, Greg

According to this SO question , you could use a single virtualenv for both version, just use the -p path/to/python/version or --python=path/to/version flag to specify which version to use for the creation of the virtual environment. Note that you can use the same flag with mkvirtualenv .

This post recommends to just use the system Python (2.7 in your case) to install virtualenv itself.

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