Most Linux comes with python2.7, and Ubuntu1.6 also comes with python3.x, this article mainly records virtualenv+vitualenvwrapper using PYTHON3 virtual environment
Virtual environment benefits not much to say, avoid version changes, so that development does not affect the role of non-
One, first install virtualenv, command
1 sudo apt-get install python-virtualenv
Second, install Virtualwrapper
Virtualwrapper is a simple and convenient tool for managing virtual environments, using commands
1 sudo pip install Virtualenvwrapper
Third, configure the Virtualwrapper environment variable
1,vim Open./BASHRC
1 sudo vim ~/.BASHRC
2, Shift+g arrive at the end of the text, add the following
3,./BASHRC takes effect only after the source ~/.BASHRC command
Four, the use of BASIC commands
1. Create a virtual environment
MKVIRTUALENV Environment Name (this environment is created based on the system variable environment, i.e. PY2)
Create a Python3 environment
Mkvirtualenv--python=/usr/bin/pyhton3 Name
2, enter the virtual environment
Workon Name
3. Exit the Virtual environment
Deactivate
There are also some commands that are not virtualwrapper, which are not described here.
Ubuntu Installation Python3 Virtual Environment