如何装ipython_安装ipython以及完善ipython等功能

本文详细介绍了在Linux环境下安装IPython的过程,包括下载ActivePython、IPython源码,以及解决安装过程中遇到的readline模块问题。通过安装ncurses库来解决链接错误,最终成功安装并验证了IPython的tab补全功能。
摘要由CSDN通过智能技术生成

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

验证:

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]st ~]# 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值