![](/img/trans.png)
[英]Oracle DB connection error with Python - cx_Oracle: cannot locate a 32-bit Oracle Client library
[英]Getting Error Connect to Oracle using Python On Mac - Cannot locate Oracle Client library
我正在尝试在 Mac 上连接到 Python 中的 Oracle 数据库,但出现以下错误:
cx_Oracle.DatabaseError:DPI-1047:找不到 64 位 Oracle 客户端库:“dlopen(libclntsh.dylib, 1): image not found”。 请参阅https://oracle.github.io/odpi/doc/installation.html#macos寻求帮助
导致错误的代码是 dsn_tns = cx_Oracle.makedsn(host='', port='', service_name='') conn = cx_Oracle.connect(user='', password='', dsn=dsn_tns)
使用 cx_Oracle 库
这是我的 lib 文件夹
$ ls -la ~/lib
总计 274272
drwxr-xr-x 7 名员工 224 Jun 25 13:31。
drwxr-xr-x+ 113 员工 3616 Jun 25 14:20..
lrwxr-xr-x 1 名员工 61 Jun 24 18:03 libclntsh.dylib -> /Users/username/oracle/instantclient_19_3/libclntsh.dylib
lrwxr-xr-x 1 名员工 51 Jun 25 13:31 libclntsh.dylib.19.1 -> /opt/oracle/instantclient_19_1/libclntsh.dylib.19.1
-rwxr-xr-x@ 1 名员工 4803832 6 月 24 日 18:31 libclntshcore.dylib.19.1
-rwxr-xr-x@ 1 名员工 8349944 6 月 24 日 18:30 libnnz19.dylib
-rwxr-xr-x@ 1 名员工 125518764 Jun 24 18:31 libociei.dylib
MacOS:Catalina 版本 10.15.5 Python 3.7.7 Oracle 客户端
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.