How to Learn: python learning path (1): python source code Installation

Source: Internet
Author: User
How to Learn: python learning path (1): python source code installation Preface

Python is a versatile language, especially in Linux. The general Linux system also comes with Python. However, it is still necessary to learn how to install Python in Linux.

Operating system version:

  1. Gaopeng @ gaopeng-virtual-machine :~ $ Uname-
  2. Linux gaopeng-virtual-machine 3.2.0-38-generic # 61-Ubuntu SMP Tue Feb 19 12:20:02 UTC 2013 i686 i686 i386 GNU/Linux

Python version:

  1. Gaopeng @ gaopeng-virtual-machine :~ $ Python
  2. Python 2.7.3 (default, Aug 1 2012, 05:16:07)
Install and configure Python

In essence, the steps for installing software in Linux are the same. Therefore, we will not explain it too much here, and run it directly to see the effect.

  1. Gaopeng @ gaopeng-virtual-machine :~ // Python $ wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
  2. -- 17:06:40 -- http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
  3. Parsing host www.python.org (www.python.org)... 82.94.164.162, 2001: 888: 2000: d: a2
  4. Connecting www.python.org (www.python.org) | 82.94.164.162 |: 80... already connected.
  5. An HTTP request has been sent and is waiting for response... 200 OK
  6. Length: 14492759 (14 M) [application/x-tar]
  7. Saving to: "Python-2.7.5.tgz"
  8.  
  9. 100% [============================================== ==================>] 14,492,759 182 K/s 88 s
  10.  
  11. 17:08:08 (162 KB/s)-saved "Python-2.7.5.tgz" [14492759/14492759])

Decompress the Python installation package.

  1. Gaopeng @ gaopeng-virtual-machine :~ /Python $ tar-zxvf Python-2.7.5.tgz
  2. Gaopeng @ gaopeng-virtual-machine :~ /Python $ ls
  3. Python-2.7.5 Python-2.7.5.tgz

The classic installation trilogy.

  1. Gaopeng @ gaopeng-virtual-machine :~ $ Cd python or Python-2.7.5/
  2. Gaopeng @ gaopeng-virtual-machine :~ /Python/Python-2.7.5 $ sudo./configure -- prefix =/usr/local/python2.7.5
  3. Gaopeng @ gaopeng-virtual-machine :~ /Python/Python-2.7.5 $ sudo make
  4. Gaopeng @ gaopeng-virtual-machine :~ /Python/Python-2.7.5 $ sudo make install

-- Prefix =/usr/local/python2.7.5 indicates to specify the installation directory of the current program.

In order to avoid conflicts, we will proceed with the soft connection.

  1. Gaopeng @ gaopeng-virtual-machine :~ /Python/Python-2.7.5 $ sudo ln-s/bin/local/python2.7.5/bin/python/bin/python2.7.5
Install EasyInstall source code

First, download the source code package.

  1. Gaopeng @ gaopeng-virtual-machine :~ // Python $ wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e

Decompress the source code package.

  1. Gaopeng @ gaopeng-virtual-machine :~ /Python $ tar-zxvf setuptools-0.6c11.tar.gz

Build and install.

  1. Gaopeng @ gaopeng-virtual-machine :~ /Python $ cd setuptools-0.6c11/
  2. Gaopeng @ gaopeng-virtual-machine :~ /Python/setuptools-0.6c11 $ sudo python2.7.5 setup. py build
  3. Gaopeng @ gaopeng-virtual-machine :~ /Python/setuptools-0.6c11 $ sudo python2.7.5 setup. py install

Establish a soft connection.

  1. Gaopeng @ gaopeng-virtual-machine :~ /Python/Python-2.7.5 $ sudo ln-s/bin/local/python2.7.5/bin/easy_install/bin/ey2.7.5

 

 

 

 

 

 

 

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.