When Python operates an Oracle database, Importerror:libclntsh.so.10.1:cannot open shared object file:no such file or

Source: Internet
Author: User

This article address: http://blog.csdn.net/kongxx/article/details/7107683

After installing the cx_oracle and Oracle Instant client packages, the following problems occur when importing packages using import Cx_oracle

Importerror:libclntsh.so.10.1:cannot open Shared object file:no such file or directory

This is because Python needs to use some Oracle libraries when manipulating Oracle databases, and the problem is that Python needs these libraries that are not in the path of the environment, and Linux is not in Ld_library_path environment variables, At this point, you need to add these library paths to the Ld_library_path.

$ whereis Oracle
$ export Ld_library_path=${ld_library_path}:/usr/lib/oracle/11.2/client/lib
Run the test again, the problem above is gone.


Resources:

cx-oracle:http://cx-oracle.sourceforge.net/
Instant client:http://www.oracle.com/technetwork/database/ features/instant-client/index-097480.html
Using Python with Oracle Database 11g:http://www.oracle.com/ Technetwork/articles/dsl/python-091105.html


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.