2 安装 readline
装 readline 之前,需要先安装 setuptools
cd /usr/src/
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11/
python setup.py install
出现"
Installed /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
" 表示安装成功
然后,安装 readline-devel ,从SuSe系统自带的DVD光盘拷贝对应rpm包.
rpm -ivh readline-devel-5.1-24.13.x86_64.rpm
rpm -ivh readline-devel-32bit-5.1-24.13.x86_64.rpm
装完这两个依赖包,就可以开始安装 readline 了
cd /usr/src/
wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
tar zxvf readline-5.2.tar.gz
cd readline-5.2/
CFLAGS="-O3 -fPIC" ./configure
(一定要加"-O3 -fPIC",不然会报错:"libreadline.a: could not read symbols: Bad value")
make CFLAGS=-fPIC
make CFLAGS=-fPIC install
3. 安装 python 的 readline 模块
cd /usr/src/
wget http://ipython.scipy.org/dist/readline-2.5.1.tar.gz
tar zxvf readline-2.5.1.tar.gz
cd /usr/src/readline-2.5.1
cp /usr/local/lib/{libreadline.a,libhistory.a} readline/
python setup.py install
出现"
Installed /usr/local/lib/python2.7/site-packages/readline-2.5.1-py2.7-linux-x86_64.egg
Processing dependencies for readline==2.5.1
Finished processing dependencies for readline==2.5.1
" 表示安装成功