Python interactive interpreter IPython installation tutorial in Linux, pythonipython

Source: Internet
Author: User

Python interactive interpreter IPython installation tutorial in Linux, pythonipython

IPython is a Python interactive Shell that provides very useful features such as automatic Code Completion, automatic indent, highlighting, and Shell command execution. 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:

Or go to the git page to download:
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 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

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:



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


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

You can.

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: 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.