Page tree
Skip to end of metadata
Go to start of metadata

对 virtualenv 的一个封装扩展,提供了许多额外的命令来方便python虚拟环境的切换,省去了许多麻烦的操作

virtualenvwrapper is a set of extensions to Ian Bicking's virtualenvtool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. 


export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

常用命令

add2virtualenvadd directory to the import path
allvirtualenvrun a command in all virtualenvs
cdprojectchange directory to the active project
cdsitepackageschange to the site-packages directory
cdvirtualenvchange to the $VIRTUAL_ENV directory
cpvirtualenvduplicate the named virtualenv to make a new one
lssitepackageslist contents of the site-packages directory
lsvirtualenvlist virtualenvs
mkprojectcreate a new project directory and its associated virtualenv
mktmpenvcreate a temporary virtualenv
mkvirtualenvCreate a new virtualenv in $WORKON_HOME
rmvirtualenvRemove a virtualenv
setvirtualenvprojectassociate a project directory with a virtualenv
showvirtualenvshow details of a single virtualenv
toggleglobalsitepackagesturn access to global site-packages on/off
virtualenvwrappershow this help message
wipeenvremove all packages installed in the current virtualenv
workonlist or change working virtualenvs
  • No labels
Write a comment...