install virtualenvwrapper:
adopt virtualenv Installing a virtual environment , It is troublesome to use , It's annoying to manage . Proposed installation virtualenvwrapper, It makes the virtual environment easy to work .
install :
1
pip
install
virtualenvwrapper
Default virtualenvwrapper Installed in the /usr/local/bin
below
We can then create a folder to store the virtual environment , Such as :
1
$
mkdir
$HOME/.virtualenvs
next , We need to configure ~/.bashrc, take virtualenv Add in :
1
2
export
WORKON_HOME=$HOME/.virtualenvs
source
/usr/local/bin/virtualenvwrapper
.sh
Give Way bashrc take effect :
1
source
~/.bashrc
such , virtualenvwrapper Just install it . We can install the virtual environment with the following command :
1
mkvirtualenv < Virtual environment name >
This is the time , Will be in WORKON_HOME Create this folder in the specified directory . We can go through workon + <Tab Key > To select a virtual environment . Other swimmers such as lsvirtualenv The command can refer to : http://pythonguidecn.readthedocs.io/zh/latest/dev/virtualenvs.html
Original website http://www.cnblogs.com/scharfsinnig/p/6700953.html