libclntsh.so:无法打开共享对象文件:Centos 8和python没有此类文件或目录

编程入门 行业动态 更新时间:2024-10-27 01:36:35
本文介绍了libclntsh.so:无法打开共享对象文件:Centos 8和python没有此类文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将python cx_Oracle与Centos 8中的oracle客户端库连接,我已经按照 cx-oracle.readthedocs.io/en/latest/user_guide/installation.html ,rpm包不起作用,所以我使用了zip包,将LD_LIBRARY_PATH配置为我解压缩oracle文件的目录,在这种情况下为:/opt/oracle/lib.

i'm trying connect python cx_Oracle with the oracle client library in Centos 8, I have followed the steps showed in cx-oracle.readthedocs.io/en/latest/user_guide/installation.html, the rpm packages don't work so i used the zip package and config the LD_LIBRARY_PATH to the dir where i unzip the oracle files, in this case: /opt/oracle/lib.

运行脚本时,我得到:

cx_Oracle.DatabaseError:DPI-1047:无法找到64位Oracle客户端库:"/opt/oracle/lib/libclntsh.so:无法打开共享对象文件:没有这样的文件或目录".请参见 cx-oracle.readthedocs.io/en/latest/user_guide/installation.html寻求帮助

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "/opt/oracle/lib/libclntsh.so: cannot open shared object file: No such file or directory". See cx-oracle.readthedocs.io/en/latest/ user_guide/installation.html for help

但是如果我运行:找到/opt/oracle/lib/libclntsh.so,它可以正常工作,并且文件在那里,根据错误消息,它的env变量正确,但是如果有人有任何建议,脚本仍然不起作用要解决此问题,我将非常感激.

but if i run: find /opt/oracle/lib/libclntsh.so it's works and the file is there, the env variable it's right according to the error message, but the script still not working, if anyone has any suggestions to fix this i would really appreciate it.

更新:当我设置DPI_DEBUG_LEVEL = 64时,我得到以下输出:

Update: when i set DPI_DEBUG_LEVEL=64 i get the following output:

ODPI [04293] 2021-04-10 15:51:06.109: ODPI-C 4.1.0 ODPI [04293] 2021-04-10 15:51:06.109: debugging messages initialized at level 64 ODPI [04293] 2021-04-10 15:51:06.110: Context Parameters: ODPI [04293] 2021-04-10 15:51:06.110: Environment Variables: ODPI [04293] 2021-04-10 15:51:06.110: ORACLE_HOME => "/opt/oracle" ODPI [04293] 2021-04-10 15:51:06.110: LD_LIBRARY_PATH => "/opt/oracle/lib" ODPI [04293] 2021-04-10 15:51:06.110: check module directory ODPI [04293] 2021-04-10 15:51:06.110: module name is /usr/local/lib64/python3.6/site-packages/cx_Oracle.cpython-36m-aarch64-linux-gnu.so ODPI [04293] 2021-04-10 15:51:06.110: load in dir /usr/local/lib64/python3.6/site-packages ODPI [04293] 2021-04-10 15:51:06.110: load with name /usr/local/lib64/python3.6/site-packages/libclntsh.so ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: /usr/local/lib64/python3.6/site-packages/libclntsh.so: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with OS search heuristics ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.19.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.19.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.18.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.18.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.12.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.12.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.11.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.11.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.20.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.20.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: load with name libclntsh.so.21.1 ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: libclntsh.so.21.1: cannot open shared object file: No such file or directory ODPI [04293] 2021-04-10 15:51:06.110: check ORACLE_HOME ODPI [04293] 2021-04-10 15:51:06.110: load in dir /opt/oracle/lib ODPI [04293] 2021-04-10 15:51:06.110: load with name /opt/oracle/lib/libclntsh.so ODPI [04293] 2021-04-10 15:51:06.110: load by OS failure: /opt/oracle/lib/libclntsh.so: cannot open shared object file: No such file or directory Traceback (most recent call last): File "cdr_parser.py", line 387, in <module> main()

该脚本仍然无法正常工作.

And the script still not working.

更新2:当我运行时:文件/opt/oracle/lib/libclntsh.so我得到:

Update 2: when i run: file /opt/oracle/lib/libclntsh.so i get:

/opt/oracle/lib/libclntsh.so: symbolic link to libclntsh.so.21.1

并运行ldd/opt/oracle/lib/libclntsh.so,输出为:

and running ldd /opt/oracle/lib/libclntsh.so the output is:

not a dynamic executable

我还验证了libaio和liabio-devel的安装,这是正确的,我的操作系统的版本是64位,而instanclient也是64位.

Also, i verified libaio and liabio-devel install and it's correct, my Os's version is 64 bits and the instanclient is 64 bit too.

推荐答案

看看错误消息中链接的文档,尤其是问题排查部分.特别是,将环境变量 DPI_DEBUG_LEVEL 设置为值64,然后再次运行脚本.这将告诉您正在搜索的所有位置以及该尝试的结果.如果这样做没有帮助,请使用记录的结果更新您的问题.这可能足以提供进一步的帮助.

Take a look at the documentation that was linked in the error message, in particular the troubleshooting section. In particular, set the environment variable DPI_DEBUG_LEVEL to the value 64 and run your script again. That will tell you all of the locations that are being searched and what the result of that attempt was. If this doesn't help, please update your question with the logged results. That may be enough to help further.

正如克里斯所说,在使用即时客户端时,请勿设置环境变量 ORACLE_HOME .此外,显示 file/opt/oracle/lib/libclntsh.so 和 ldd/opt/oracle/lib/libclntsh.so 的结果,并以此更新您的问题信息.

as Chris mentioned, don't set the environment variable ORACLE_HOME when using the instant client. In addition, show the results of file /opt/oracle/lib/libclntsh.so and ldd /opt/oracle/lib/libclntsh.so and update your question with this information.

更多推荐

libclntsh.so:无法打开共享对象文件:Centos 8和python没有此类文件或目录

本文发布于:2023-07-04 11:11:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1023632.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   此类   无法打开   对象   目录

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!