The original version is 2.4. The python module is reported when scons is installed.
So in SUSE Linux, upgrade to 2.6.
If you want to use the rpm-e command to delete python, You cannot delete it because of software dependency.
So use the source code package for installation and upgrade
Download 2.6.8
Http://www.python.org/download/releases/2.6.8/
Create the installation directory mkdir/usr/local/python2.6
Compile and install./configure -- prefix =/usr/local/python2.6 make & make install
Create a connection
Mv/usr/bin/python/usr/bin/python_bak (Save the original version)
Ln-s/usr/local/python2.6/bin/python/usr/bin
Test Results
Nothing goes smoothly...
Error...
ImportError: No module named readline
Google ~ It seems that the readline module is missing
2. Install readline
Before installing readline, install 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
"Indicates that the installation is successful.
Then, install readline-devel and copy the corresponding rpm package from the DVD disc that comes with the SuSe system.
Rpm-ivh readline-devel-5.1-24.13.x86_64.rpm
Rpm-ivh readline-devel-32bit-5.1-24.13.x86_64.rpm
After installing these two dependent packages, you can start to install 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
(You must add "-O3-fPIC". Otherwise, the error "libreadline. a: cocould not read symbols: Bad value" will be reported ")
Make CFLAGS =-fPIC
Make CFLAGS =-fPIC install
3. Install the python readline Module
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
"Indicates that the installation is successful.
Then, when you press python, the prompt "ImportError: No module named readline" will not appear.
[Root@10.204.140.127] # python
Python 2.7 (r27: 82500, Sep 12 2012, 19:00:00)
[GCC 4.1.2 20070115 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>