安装ipython
下载:ipython-2.3.0.tar.gz及ActivePython-2.7.8.10-linux-x86_64.tar.gz和readline-6.2.4.1.tar.gz
安装Python2.7:
tar zxvf ActivePython-2.7.8.10-linux-x86_64.tar.gz
cd ActivePython-2.7.8.10-linux-x86_64
./install.sh
ln -s /opt/ActivePython-2.7/bin/* /usr/local/bin
安装ipython:
tar zxvf ipython-2.3.0.tar.gz
cd ipython-2.3.0
python2.7 setup.py install
验证:
[[email protected] ~]# ipython
Python 2.7.8 (default, Jul 2 2014, 22:10:09)
Type "copyright", "credits" or "license" for more information.
IPython 2.3.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]:
注意:此时的ipython没有tab等功能,必须添加readline模块。
安装readline:
tar zxvf readline-6.2.4.1.tar.gz
cd readline-6.2.4.1
python2.7 setup.py install
===========Error===================
以上略....
gcc -pthread -shared build/temp.linux-i686-2.5/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-i686-2.5/readline.so
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
error: command ‘gcc‘ failed with exit status 1
===========End Error===============
查找发现原来是缺少ncurses库,没办法,继续安装ncurses
[[email protected] ~]# yum install ncurses*
[[email protected] ~]#python2.7 setup.py install ##完成安装
====================Ok================================
Adding readline 6.1.0 to easy-install.pth file
Installed /usr/local/lib/python2.5/site-packages/readline-6.1.0-py2.5-linux-i686.egg
Processing dependencies for readline==6.1.0
Finished processing dependencies for readline==6.1.0
=====================End Ok============================
[[email protected] ~]# ipython ##验证安装成功
Python 2.7.8 (default, Jul 2 2014, 22:10:09)
Type "copyright", "credits" or "license" for more information.
IPython 2.3.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]: import su ##tab补齐
subprocess sunau sunaudio
接下来Ipython就可以和我们好好玩耍了!!