This article is mainly used to record the Python environment to build some of the less commonly used commands, other installation steps can be found in other masters are not listed in detail. (Note: The following actions are in the Ubuntu14.04lts version)
I. Environmental query-related
1. Query the package and version information installed in the current Python environment.
Pip Freeze
Two. Virtual environment-related
1. Using virtualenv to establish a virtual environment
[Email protected]:~$ export virtual_use_distribute=true[email protected]:mkdir ~/ Work[email protected]:~$ cd ~/work/[email protected]:env
2. Virtual Environment activation
env/bin/Activate (env
3. Exiting the virtual environment
(env) [Email protected]:~/work$ Deactivate [email protected]:~/work$
4. Powerful Virtualenvwrapper
(1) Installation Virtualenvwrapper
Install Virtualenvwrapper
(2) Modify. BASHRC
if Then export Workon_home= $HOME/. Virtualenvs /usr/local/bin/virtualenvwrapper. SHfi
(3) Update. BASHRC Environment
[Email protected]:~/work$ Source ~/.BASHRC
(4) Create a virtual environment
[Email protected]:~/work$ mkvirtualenv newenv (newenv) [email protected]:
(5) Exiting the virtual environment
(newenv) [Email protected]:~/work$ Deactivate [email protected]:
(6) Entering the virtual environment
[Email protected]:~/work$ Workon newenv (newenv) [email protected]:
(7) View the virtual environment inside the current environment
[Email protected]:~/work$ Workon newenv
(8) Deleting a virtual environment
[Email protected]:~/work$ rmvirtualenv newenvremoving newenv ... [Email protected]:~/work$ workon[email protected]:
5. Using different versions of Python (implemented through a virtual environment)
Python2. 7 [email protected]:~/work$ mkvirtualenv--python=/usr/bin/python2. 7 Newenv2python3. 4 [email protected]:~/work$ mkvirtualenv--python=/usr/bin/python3. 4 Newenv3
"Python" Python Environment setup