安装:python
1、安装(要有python环境+pip): * sudo pip install virtualenvwrapper 2、配置: 执行:vi ~/.bash_profile 在~/.bash_profile中添加: export VIRTUALENV_USE_DISTRIBUTE=1 # <-- Always use pip/distribute export WORKON_HOME=$HOME/virtualenvs # <-- Where all virtualenvs will be stored source /usr/local/bin/virtualenvwrapper.sh export PIP_VIRTUALENV_BASE=$WORKON_HOME export PIP_RESPECT_VIRTUALENV=true 3、是~/.bash_profile文件生效 source ~/.bash_profile
经常使用指令:bash
1、建立虚拟环境 mkvirtualenv test(续集环境名称) 2、进入虚拟环境 workon test 3、列出全部虚拟环境 workon 4、离开虚拟环境 deactivate 5、删除虚拟环境 rmvirtualenc test 6、进入虚拟环境目录 cd ~/virtualenvs/test