I am also a Python enthusiast, it is well known that Python extension, every time in order to test, install a variety of extensions, so that the local Python environment is very confusing, someone think of an isolated environment and the local environment is not related, can remove this isolation environment at any time, create, This is the Python virtual environment virtualenv (is not the feeling and the virtual operating system a bit similar Virtualbox)
Proceed directly to the following steps
Installing Virtualenv
$ sudo apt-get install Python-dev #python开发包 $ wget https://pypi.python.org/packages/source/v/virtualenv/ virtualenv-13.1.2.tar.gz#md5=b989598f068d64b32dead530eb25589a$ TAR-XVF virtualenv-13.1.2.tar.gz$ CD virtualenv-13.1.2/$ sudo python setup.py install
Create a virtual environment
$ virtualenv Vir_python
Activating a virtual environment
$ source Vir_python/bin/activate
Exiting a virtual environment
$ deactivate
Installation Extension Example
Using the Package tool PIP or Easy_install
$ pip Install [package name]
Installing the MySQL Extension
$ sudo apt-get install libmysqld-dev$ sudo easy_install mysql-python
PS: There is a virtualenvwrapper can be used to manage the virtual environment, interested friends can try to
Original address: Python Virtual Environment virtualenv
Python Virtual Environment virtualenv