This article is about Ubuntu under the Python basic Environment python2.7 (why 2.7 instead of 3?). Tornado 2.7 Support is better, and many packages are also supported 2.7)
1.
Input python found that there is no python3
Python3 can. Install the Python2
2.
(The default Python is version 2.7)
It'll be a success.
2. Install Pip
Some Linux distributions can install PIP directly with Package Manager, such as Debian and Ubuntu
sudo apt-get install Python-pip
About PIP3 need to use the installation under Python3
How to use the Python3 pip:
PIP installation under #比如说要使用python3 Tornado python3-m pip install tornado
#程序 to run with Python3
Python3 test.py
3. Installing virtualenv
Virtualenv is an environment manager for Python that isolates each environment
Pip Isntall virtualenv
Virtualenv's specific use reference Liaoche's website
4. Installing the virtualenv Extension tool
sudo easy_install virtualenvwrapper
Then configure
(Specific in/usr/local/bin/virtualenvwrapper.sh there are virtualenvwrapper documents)
To create a hidden directory:
#创建隐藏目录 mkdir $HOME/.virtualenvs
Open the current directory with VI (available LS-A view). bashrc file
VI. BASHRC
#移动光标到最后一行, enter 2 lines at the end (the cursor to the last 2 lines I input does not use the VI clickable connection)
Export Workon_home= $HOME/.virtualenvs
source/usr/local/bin/virtualenvwrapper.sh
Esc
SHIFT +: Key
Enter Wq return to exit
6. Enter run
SOURCE ~/.BASHRC
Basic construction of Python infrastructure in Ubuntu 0 base station