virtualenvwrapper 方便的virtualenv 包装
作者:互联网
virtualenvwrapper 是一个方便的virtualenv 包装我们可以用来方便的管理python 的开发环境,同时
也支持对于项目的管理
安装
- pip 安装
pip install virtualenvwrapper
- 配置环境变量
配置 .bashrc or .profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/mylearning/venv-apps
source /usr/local/bin/virtualenvwrapper.sh
基本使用
- 初始化项目
mkvirtualenv mydemo
效果
Using base prefix '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/dalong/.local/share/virtualenvs/mydemo/bin/python3.7
Also creating executable in /Users/dalong/.local/share/virtualenvs/mydemo/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /Users/dalong/.virtualenvs/mydemo/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/dalong/.virtualenvs/mydemo/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/dalong/.virtualenvs/mydemo/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/dalong/.virtualenvs/mydemo/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/dalong/.virtualenvs/mydemo/bin/get_env_details
- 项目管理
安装并配置了virtualenvwrapper 之后会有mkproject 命令,方便我们进行已有项目集成virtualenv ,同时支持
模版,注意是通过template 插件处理的
mkproject -t bitbucket -t django my_site
参考资料
https://virtualenvwrapper.readthedocs.io/en/latest/install.html
标签:virtualenv,bin,Users,virtualenvs,包装,dalong,virtualenvwrapper,mydemo 来源: https://www.cnblogs.com/rongfengliang/p/10898001.html