安装依赖开发包
yum install readline-devel
yum install *argparse*
wget https://www.python.org/ftp/python/2.7.6/Python2.7.6.tgz
ipython 下载地址https://github.com/ipython/ipython/releases/download/rel-2.1.0/ipython-2.1.0.tar.gz
编译安装python 2.7.6
[[email protected] ~]# tar -xf python-2.7.6.tgz
[[email protected] Python-2.7.6]# ./configure --prefix=/usr/local/python2.7
[[email protected] Python-2.7.6]# make && make install
安装 ipython 补全插件
[[email protected] ~]# tar -xf ipython-5.2.2.tar.gz
[[email protected] ~]# cd ipython-5.2.2
[[email protected] ipython-5.2.2]# /usr/local/python2.7/bin/python2.7 setup.py install
创建软连接
[[email protected] ~]# ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27
[[email protected] ~]# ln -sv /usr/local/python27/bin/ipython /usr/bin/
报错 1,
[[email protected] bin]# /usr/local/python2.7/bin/ipython
Traceback (most recent call last):
File "/usr/local/python2.7/bin/ipython", line 4, in <module>
from IPython import start_ipython
File "/usr/local/python2.7/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
from .core.application import Application
File "/usr/local/python2.7/lib/python2.7/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
ImportError: No module named traitlets.config.application
先 yum install *argparse* 再重新编译安装 python