Solve error while loading shared libraries: libpython2.7.so. 1.0: cannot open shared object file: No Su

Source: Internet
Author: User
If python2.7 is installed, the first execution reports an error: Error while loading shared libraries: libpython2.7.so. 1.0: cannot open shared object file: no such file or directory.
Solution: 1. edit VI/etc/lD. so. if the conf file is not logged on with a root account, use sudo VI/etc/lD. so. add the Lib library address of python2.7 in Conf, for example, my/usr/local/python2.7/lib, and save the file

2. Run the/sbin/ldconfig-V command. If you are logged on with a non-root account, use sudo/sbin/ldconfig-v. This way
LDD can be used to find this database. If you run python2.7, no error will be reported.
/Etc/lD. So. conf:
This file records the path of the dynamic link library used during compilation.
By default, the compiler only uses the library files in the/lib and/usr/lib directories.
If you have installed some libraries without specifying -- prefix =/usr, the Lib library will be installed under/usr/local, but not in/etc/lD. so. if/usr/local/lib is added to the conf file, an error is returned.
What is ldconfig:
It is a program, usually located under/sbin, which is used by the root user. The specific functions and usage can be found in man ldconfig.
To put it simply, it caches the library files in the paths listed in/etc/lD. So. conf to/etc/lD. So. cache for use.
Therefore, after installing some library files (such as just installed Glib), or modifying lD. So. conf to add a new library path, run/sbin/ldconfig
Make all the library files cached in LD. So. cache. If it is not done, it will not be used even if the library file is clearly under/usr/lib.
During compilation, the xxx library is missing.

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.