DPI-1047: 64-bit Oracle Client library cannot be loaded

linux python3连接oracle报错DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory"的解决方案
在Linux上使用python运行数据库脚本的时候报:cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded
这个问题的原因可能是linux上未安装oracle客户端,可能是安装的是32位oracle客户端但python及cx_orcale是64位的
解决方法:下载安装instantclient-basic,并配置环境变量
instantclient-basic下载地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
rpm包安装:
# sudo yum install oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
# sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"# sudo ldconfig

安装并配置完成后如果仍报错,请检查/usr/lib/oracle/12.2/client64/lib下libclntsh.so的全称,
我本地是libclntsh.so.12.2,修改或者软连接为libclntsh.so
ln-slibclntsh.so.12.1libclntsh.so

cplibclntsh.so.12.1libclntsh.so



我的回答