Linux installation Python2.7__linux

Source: Internet
Author: User

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 ....



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.