Building a Python environment

Source: Internet
Author: User

1, downloadPython

There are two types of Linux platforms,

Python 2.7compressed Source Tarball (For Linux, Unix or OS X)

Python 2.7bzipped Source Tarball (Forlinux, Unix or OS x,more compressed)

The second kind of compression is better, in Linux with bzip2 compressed file is relatively high, the file name is generally *.tar.bz2, but the second version of http. WWW.PYTHON.ORG/FTP/PYTHON/2.7/PYTHON-2.7.TAR.BZ2 This is the version of 2.7, not what I want, the connection in the 2.7 to change to 2.6 Will be able to go down to the version you want to install.

2, decompression

The downloaded package can be decompressed using the tar command, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6B/74/wKiom1Ut-uiyHzTnAAFB52ibZ4M080.jpg "title=" Untitled. png "alt=" wkiom1ut-uiyhztnaafb52ibz4m080.jpg "/>

3, compiling, and installing

Linux generally installs user-installed software into the/usr/local/xxx/ , with configure and make, the Install These commands can be compiled and installed,--prefix Specify the destination directory to install, as follows:

go to python-2.6 folder
./configure--prefix=/usr/local/python-2.6
Make
Make install

4, detect, and set environment variables

Add path= $PATH in the /etc/profile file :/Usr/local/python-2.7.9/bin and source/etc/profile

Enter python2.7 directly to enter Python

5,IpythonSource Installation

to git page download:https://github.com/ipython/ipython/downloads
Suppose we download a file named:ipython-0.8.2.tar.gz
#tar zvxfipython-0.8.2.tar.gz // Unzip files
#cdipython -0.8.2 // Enter the folder you just unzipped

Enter the file and you will see a setup.py installation script, run the following command to install the
#pythonsetup. PY Install

This will install the Ipyhon library file in the Site-packages directory and create a Ipython script in the scripts directory . In Unix systems, the directory is the same as the Python binary file directory. If a python package is already installed on the system , Ipython will be installed in the/usr/bin directory.


Building a Python environment

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.