Tutorial on installing Python interactive interpreter IPython in Linux

Source: Internet
Author: User
IPython is a Python-based Shell. with the support of the Python programming language, IPython is more powerful than the general Shell. next, let's take a look at the tutorial of installing the Python interactive interpreter IPython in Linux. IPython is the Python interactive Shell, which provides automatic code completion, automatic indent, and highlighted display, execute Shell commands and other very useful features. In particular, its code completion function, for example, after entering zlib. press the Tab key, IPython will list all the attributes, methods, and classes under the zlib module. It can replace the built-in bash.

The following describes how to install IPython in linux:

First: install ipython source code
Ipython Source Code Download Page: https://pypi.python.org/pypi/ipython

Or go to the git page to download: https://github.com/ipython/ipython/downloads
Suppose the file we downloaded is: ipython-0.8.2.tar.gz

# Tar zvxf ipython-0.8.2.tar.gz // Unzip the file # cd ipython-0.8.2 // enter the folder you just decompressed

Enter the file and you will see a setup. py installation script. run the following command to install

#python setup.py install

The ipyhon library file is installed in the site-packages directory, and an ipython script is created in the scripts directory. In unix systems, this directory is the same as the python binary file directory. If the python package has been installed in the system, ipython will be installed in the/usr/bin directory.

Method 2: install the ipython software package through the software package manager of the system.
For example, you can obtain the. deb package on debian and ubuntu by using the following command:

#apt-get install ipython

// Ubuntu installs ipython library files to the/usr/share/python-support/ipython Directory, including a series. pth file and symbolic link, while ipython binary file is installed in the/usr/bin/ipyton directory.


Redhat (centos) uses the following command:

# Yum list | grep ipython // check whether the yum source you are using has an ipython package. if not, you can only change the source or source code for installation, none in China # yum install ipython. noarch // install ipython

Or install it through the rpm Package. the command is as follows:

#rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/ipython-0.10-3.el6.noarch.rpm

Third: install python package.
Ipython is included in the python package. After extracting the python package, you can see a file with the extension. egg. You can install the Egg file using the easy_install tool. The easy_install tool can check the configuration of the egg file and then select the content to be installed. The easy_install tool uses the python package index (PyPI, also known as python cheeseshop) to determine the installation of the package. To install ipython using easy_install, you only need to have the write permission on the site_package directory and directly run

#easy_install ipython

Ps: If you have installed the easy_install tool, you must install setuptools before using the easy_install tool.

Type 4: use it directly without installation.
Download the source code of ipython and run the ipython. py installation command to use the ipython instance in the downloaded version. This method makes the site-packages directory concise, but it also brings about some problems. if ipython is not decompressed, the PYTHONPATH environment variable is not modified, ipython cannot be used directly as a library file.

I personally suggest installing it through source code.

If you have any questions, go to the official website to view the installation document tutorial:

Http://ipython.org/ipython-doc/stable/install/install.html

Http://ipython.org/install.html


PS: the gcc: readline/libreadline. a error is reported.
Ipython is a very useful tool, but the following two errors are reported during installation in linux. (The environment is centos6.2, python2.7)

gcc: readline/libreadline.a: No such file or directorygcc: readline/libhistory.a: No such file or directory

Solution:
Only

yum -y install readline-develyum -y install patchpip install ipython

You can.

The above is the tutorial for installing Python's interactive interpreter IPython in Linux. For more information, see PHP Chinese network (www.php1.cn )!

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.