1.为了可以使用backspace、delete等,安装readline-devel

    yum install readline-devel

2.下载python

3.编译python

    cd到对应目录

    ./configure --prefix=/usr/local/python27

    make && make install

4.为了可以使用ipython历史命令,安装SQlite

5.编译ipython

    cd到相应目录,使用刚才装好的python解释执行setup.py文件

    /usr/local/python27/bin/python setup.py build

    然后,

    /usr/local/python27/bin/python setup.py install

6.创建python和ipython命令的链接:

    ln -sv /usr/local/python27/bin/python /usr/bin/python27

    ln -sv /usr/local/python27/bin/ipython /usr/bin/ipython

这样,就可以在bash中使用python或ipython切换到交互界面了~

完毕!


现在,如果需要给系统自带的python2.6做一个ipython:

首先

rm -f /usr/bin/ipython删掉2.7版本的链接

ln -s /usr/local/python27/bin/ipython /usr/bin/ipython27

下载ipython-0.12.tar.gz

tar xf ipython-0.12.tar.gz

cd ipython-0.12

python setup.py build

python setup.py install

注意不要用python27,不然就变为2.7版本的ipython