python独立环境——virtualenv
安装:
pip3 intall virtualenv
创建独立运行环境:
1. 进入项目文件夹根目录
2. 创建环境
Mac:myproject michael$ virtualenv --no-site-packages venv
Using base prefix \'/usr/local/.../Python.framework/Versions/3.4\'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip, wheel...done.
3. --no-site-packages参数,不拷贝已经安装到系统中的第三方包
进入独立运行环境:
Mac:myproject michael$ source venv/bin/activate
(venv)Mac:myproject michael$
退出独立运行环境:
(venv)Mac:myproject michael$ deactivate
Mac:myproject michael$