IPython是Python的交互式Shell,提供了代码自动补完,自动缩进,高亮显示,执行Shell命令等很是有用的特性。特别是它的代码补完功能,例如:在输入zlib.以后按下Tab键,IPython会列出zlib模块下全部的属性、方法和类。彻底能够取代自带的bashpython
1.yum安装(推荐)
2.手动下载源码包安装git
2版本的ipython只须要安装epel源而后yum直接安装就可,不须要手动安装:github
[root@wing ~]#yum install epel-release -y [root@wing ~]#yum install ipython -y 也能够直接用命令 # pip install ipython 安装
安装完以后便可运行ipython: [root@wing Desktop]# ipython Python 2.7.5 (default, Aug 4 2017, 00:39:18) Type "copyright", "credits" or "license" for more information. IPython 3.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]:
3版本的ipython3安装只须要使用python3用下面命令安装便可bash
[root@wing ~]# python3 -m pip install ipython 安装完运行ipython3: [root@wing ~]# ipython3 Python 3.6.2 (default, Sep 14 2017, 15:13:07) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]:
到这里其实已经结束了,若是你纠结源码方式安装,接着往下看python2.7
手动从官网下载安装包的安装方式以下:
ipython下载:ide
官网下载 :https://pypi.python.org/pypi/ipython 或者 git页下载:https://github.com/ipython/ipython/downloads
下载的安装包文件名为:
ipython-5.0.0.tar
#注意只有1.0版本才支持2.6的python,其余高版本必需要python2.7以上
#tar zvxf ipython-5.0.0.tar #解压
#cd ipython-5.0.0 #进入解压目录
#python setup.py install #安装
该操做将会在site-packages目录中安装ipyhon的库文件,并在scripts目录中建立一个
ipython脚本。在unix系统中,该目录与python的二进制文件目录相同,若是系统中已经安
装了python包,则ipython将会安装在/usr/bin目录下。网站
启动以后,报错:ui
ImportError: No module named 'traitlets' ... 后面会报不少相似缺模块的错误,是由于缺依赖包
安装如下依赖模块:
全部依赖模块都是在https://pypi.python.org/pypi/这个网站下载(右上角搜索框直接搜索模块名称),这些模块的安装方式跟上面ipython的安装方式同样unix
traitlets、ipython_genutils、decorator、pexpect、pickleshare、path.py、 setuptools、setuptools_scm、simplegeneric、 backports.shutil_get_terminal_size、ipython_genutils、prompt_toolkit、 ptyprocess、Pygments
两个小时以后(我这网速也是..哎,泪奔),终于成功了!
意外:若是你用的是Debian系统,恭喜你,能够直接用最简单的方式从Debian系统镜像安装使用Ipythoncode
作软链接:
使用ipython,界面以下:
[root@vm2 ~]# ipython Python 2.7.10 (default, Aug 12 2016, 14:14:35) Type "copyright", "credits" or "license" for more information. IPython 5.0.0 -- 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]: