The simplest installation steps were found on the Web:
1. Download python2.7.5, save to/data/qtongmon/software
http://www.python.org/ftp/python/
2. Extract Files
Tar xvf python-2.7.5.tar.bz2
3. Create installation directory
Mkdir/usr/local/python27
4. Install Python
./configure--prefix=/usr/local/python27
Make
Make install
5. Modify the old version of Ln pointing (Note: This may affect the use of yum after modification)
mv/usr/bin/python/usr/bin/python2.4.3
Ln-s/usr/local/python27/bin/python/usr/bin/python installation was successful.
As the other modules continued to be installed, the tragedy occurred:
... relocation r_x86_64_32 against ' a local symbol ' can is used when making a shared object; Recompile with-fpic
... could not read Symbols:bad value
Workaround compiler has prompted: Recompile with-fpic
How to compile with this parameter, the original is to recompile python.
./configure--prefix=/usr/local/–enable-shared cflags=-fpic make make install
The recompile succeeded.
But the new problem comes up again:
Libpython2.7.so.1.0:cannot open Shared object file:no such file or directory
Solution:
1. Cp/usr/local/python27/lib/libpython2.7.so.1.0/usr/local/lib
Cd/usr/local/lib
Ln-s libpython2.7.so.1.0 libpython2.7.so
2. Use the command Whereis libpython2.7.so.1.0 get the following results to explain
Libpython2.7.so.1:/usr/local/lib/libpython2.7.so.1.0
Finally get it done ....