安裝ipython以及完善ipython等功能

安裝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

驗證:

[root@localhost ~]# 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 

[root@localhost ~]# yum install ncurses*

[root@localhost ~]#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============================


[root@localhost ~]# 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就可以和我們好好玩耍了!!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章