同时为 Python 2.7 和 3.6 安装 virtualenvwrapper [英] Install virtualenvwrapper for Python 2.7 and 3.6 simultaneously

查看:65
本文介绍了同时为 Python 2.7 和 3.6 安装 virtualenvwrapper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为 Python 2.73.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 包管理器安装 python2python3.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆