码迷,mamicode.com
首页 > 编程语言 > 详细

安装ipython以及完善ipython等功能

时间:2014-11-11 02:12:44      阅读:2065      评论:0      收藏:0      [点我收藏+]

标签:安装ipython   ipython的tab功能安装   安装python2.7   

安装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就可以和我们好好玩耍了!!


本文出自 “为了工作顺利学习好系统” 博客,请务必保留此出处http://stlong.blog.51cto.com/5144113/1575085

安装ipython以及完善ipython等功能

标签:安装ipython   ipython的tab功能安装   安装python2.7   

原文地址:http://stlong.blog.51cto.com/5144113/1575085

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!