同时为 Python 2.7 和 3.6 安装 virtualenvwrapper [英] Install virtualenvwrapper for Python 2.7 and 3.6 simultaneously
问题描述
如何为 Python 2.7
和 3.6
版本安装 virtualenvwrapper
?我的默认 Python 环境是 Python 3.6
,因此 virtualenvwrapper
是为 Python 3.6
而不是 2.7
安装的.我使用的是 macOS Sierra 10.12.6
.
How does one install virtualenvwrapper
for both Python 2.7
and 3.6
versions? My default Python environment is Python 3.6
and as such virtualenvwrapper
is installed for Python 3.6
and not 2.7
. I'm using macOS Sierra 10.12.6
.
推荐答案
您只需要 安装virtualenvwrapper
一次.请参阅有关在基本 Python 安装上安装的警告.
You need only install virtualenvwrapper
once. See the warning about installing on your base Python installation.
使用 Homebrew 包管理器安装 python2
和 python3
.
Using Homebrew package manager install python2
and python3
.
制作虚拟环境就是传递一个标志.
Making a virtual environment is a matter of passing a flag.
# make py3
mkvirtualenv py3 --python=python3
# make py2
mkvirtualenv py2 --python=python2
这篇关于同时为 Python 2.7 和 3.6 安装 virtualenvwrapper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!