Compile a 64-bit libpython2.6.so.1.0 library under CentOS

Source: Internet
Author: User

The default Python version of Python is 2.4. If you're unlucky with Yum, Installpython26 to install the python2.6, although the installation of the time will not be a problem, but there will be no libpython2.6.so.1.0 this library, even if the installation of the python-libs is not used, which for many need dynamic loading Libpython program is not Of So you need to install through the source code.

1. Download the Python source code. Like 2.6.5 or 2.6.6.

2. After decompression configure:

./configure--prefix=/usr/local/python2.6--with-threads--ENABLE-SHARED--ENABLE-UNIVERSALSDK

The--prefix option indicates that the target is compiled into the/usr/local/python2.6 directory.

Attention:

A. If you use only the./configure command, the default is to compile a static. A and 32-bit dynamic library.

B. The last option is very important. If this option is not added, it will only compile 32-bit libraries.

3. Make &&make Install

When you execute Python, you are likely to report a mistake:

libpython2.6.so.1.0:

Cannotopen Shared object File:no such file or directory

This is because the compiled libpython2.6.so.1.0 is inside the/usr/local/python2.6/lib, can make a soft link to/usr/lib64, or just copy it to the past on the line.

Or you can do this:

echo '/usr/local/python2.6/lib ' >/etc/ld.so.conf.d/opt-python2.6.conf

Then execute

Ldconfig

Finally, you can verify that there are 64-bit Libpython by using the following command:

Ldconfig–p | grep python

See if there is any output similar to "libpython2.6.so.1.0 (libc6,x86-64) =>/usr/local/python2.6/lib/libpython2.6.so.1.0".

Related Article

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.