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