linux下编译安装Python环境与iPython

1
2
安装readline-devel,解决交互退格删除键无法使用问题
yum insatll readline-deve
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
python.org下载Python2.7.7
wget https://www.python.org/ftp/python/2.7.7/Python-2.7.7.tar.xz
tar xf Python-2.7.7.tar.xz
cd Python-2.7.7
./configure --prefix=/usr/local/python27
#验证:
[root@iZ28ixc7zmxZ Python-2.7.7]# /usr/local/python27/bin/python2.7
Python 2.7.7 (default, Feb 28 2017, 23:52:42)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "python27"
python27
>>>
#Python2.7 安装成功
#iPython程序包自行百度下载.(增加tab键补齐)
#ipython是一个程序,需要使用新安装的Python27来安装
tar xvf ipython-1.2.1.tar.gz
cd ipython-1.2.1
/usr/local/python27/bin/python2.7 setup.py install
ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27
`/usr/bin/python27' -> `/usr/local/python27/bin/python2.7'
ln -sv /usr/local/python27/bin/ipython /usr/bin/ipython
安装完毕。