Python Basics (1)--Compile and install

Source: Internet
Author: User

System: Centos6.4 x86_64 default version is 2.6.6

Prepare package: System default version 2.6.6 install 2.7.6 default version here do not move.

Ipython-1.2.1.tar.gz PYTHON-2.7.6.TAR.XZ


    • Ipython is a python interactive shell that works much better than the default Python shell, supports variable auto-completion, auto-indent, supports bash shell commands, and has many useful functions and functions built into it. Under Ubuntu as long as sudo apt-get install Ipython installed, through Ipython boot.

Installation process:

[Email protected] ~]# tar XF python-2.7.6.tar.xz

[Email protected] ~]# CD Python-2.7.6

[[email protected] python-2.7.6]# ls

Config.guess Configure Demo Grammar install-sh LICENSE Makefile.pre.in Modules Parser pcbuild Python R Iscos Tools

Config.sub configure.ac Doc Include Lib Mac Misc Objects PC pyconfig.h.in README s etup.py

[Email protected] python-2.7.6]# yum install readline-devel-y #编译出的python可以使用删除键等.

[Email protected] python-2.7.6]#/configure--prefix=/usr/local/python27

[[email protected] python-2.7.6]# make && make install

[email protected] python-2.7.6]# cd/usr/local/python27/bin

[[email protected] bin]# ls

2to3 idle Pydoc python python2 python2.7 python2.7-config python2-config python-config smtpd.py

[email protected] bin]# pwd

/usr/local/python27/bin

[email protected] bin]#./python2.7

Python 2.7.6 (default, Feb 26 2016, 11:02:52)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2

Type "Help", "copyright", "credits" or "license" for more information.

>>> print "Hello World"

Hello World

Installing Ipython

[email protected] python]# tar xf ipython-1.2.1.tar.gz

[email protected] python]# CD ipython-1.2.1

[email protected] ipython-1.2.1]#/usr/local/python27/bin/python2.7 setup.py build

[email protected] ipython-1.2.1]#/usr/local/python27/bin/python2.7 setup.py Install

[email protected] ipython-1.2.1]# ls/usr/local/python27/bin/

2to3 ipcluster ipengine iptest irunner pydoc python2 python2.7-config python-config

Idle Ipcontroller iplogger ipython pycolor python python2.7 python2-config smtpd.py

Make the command connection easy to use

[email protected] ipython-1.2.1]# ln-sv/usr/local/python27/bin/python2.7/usr/local/bin/ Python27

"/usr/local/bin/python27", "/usr/local/python27/bin/python2.7"

[email protected] ipython-1.2.1]# ln-sv/usr/local/python27/bin/ipython/usr/local/bin/

"/usr/local/bin/ipython", "/usr/local/python27/bin/ipython"

Using Ipython

[email protected] ~]# Ipython

Warning:ipython requires SQLite, your history won't be saved

Python 2.7.6 (default, Feb 26 2016, 11:02:52)

Type "Copyright", "credits" or "license" for more information.

IPython 1.2.1--an enhanced Interactive Python.

? Introduction and overview of IPython ' s features.

%quickref, Quick Reference.

Help, Python ' s own Help system.

Object? Details about ' object ', use ' object? ' for extra details.

In [1]: print "Hello World"

Hello World

In [2]: Import platform

In [3]: Print

Print

In [3]: Print platform

<module ' platform ' from '/USR/LOCAL/PYTHON27/LIB/PYTHON2.7/PLATFORM.PYC ' >

Complete.

Python Basics (1)--Compile and install

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.