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
DPI-1047: 64-bit Oracle Client library cannot be loaded
相关推荐
- MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause …问题解决
- ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'return_create_time'
- MySQL5.5升级到MySQL5.7,数据库导入日期出错问题解决
- MySQL如何优化DISTINCT?
- MySQL如何优化IS NULL?
- 怎么对MySQL估计查询性能优化?
- MySQL安装报错:my_global.h151615 error new No such file or directory