Basic construction of Python infrastructure in Ubuntu 0 base station

Source: Internet
Author: User
Tags virtualenv

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.