1、下载Python2.7.11
https://www.python.org/downloads/release/python-2711/
解决一个依赖关系
yum install readline-devel 解压、安装
tar xvf Python-2.7.11.tar.xz
cd Python-2.7.11
./configure --prefix=/usr/local/python27
make&&make install
2、下载ipython
https://pypi.python.org/pypi/ipython/4.2.0
tar xvf ipython-4.2.0.tar.gz
cd ipython-4.2.0
/usr/local/python27/bin/python2.7 setup.py install
ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27
ln -sv /usr/local/python27/bin/ipyton /usr/bin/
使用ipython时直接报错
1、报错:ImportError: No module named traitlets
在github 上下载https://github.com/ipython/traitlets
# /usr/local/python27/bin/python2.7 setup.py install
2、报错:ImportError: No module named ipython_genutils
在github 上下载https://github.com/ipython/ipython_genutils
# /usr/local/python27/bin/python2.7 setup.py install
3、报错:ImportError: No module named decorator
在github 上下载https://github.com/micheles/decorator
# /usr/local/python27/bin/python2.7 setup.py install
4、报错:ImportError: No module named setuptools
https://pypi.python.org/pypi/setuptools_scm/#downloads
# /usr/local/python27/bin/python2.7 setup.py install
5、报错:ImportError: No module named pexpect
在github 上下载https://github.com/pexpect/pexpect
# /usr/local/python27/bin/python2.7 setup.py install
6、报错ImportError: No module named ptyprocess
https://pypi.python.org/pypi/ptyprocess#downloads
7、报错ImportError: No module named backports.shutil_get_terminal_size
https://pypi.python.org/pypi/backports.shutil_get_terminal_size/1.0.0#downloads
8、报错ImportError: No module named pickleshare
https://pypi.python.org/pypi/pickleshare/0.6
9、报错ImportError: No module named path
https://pypi.python.org/pypi/path.py/8.2.1
10、报错ImportError: No module named simplegeneric
https://pypi.python.org/pypi/simplegeneric/
直接下载安装,安装时要使用python27 setup.py install
解决完之后就可以使用ipython
至此环境搭建完成
原文链接:https://www.f2er.com/centos/382019.html