我尝试在python中使用cx_oracle连接到oracle,但出现错误。
尝试过
:我什至格式化了机器并更新了Java版本。
Amazon Python 2.7 Lambda: DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so" 但仍然没有用。
使用的版本:python 3.7,Anaconda 3.7
import cx_Oracle
connect_string = 'Username/password@hostname:port/sid'
connection = cx_Oracle.connect(connect_string)
cursor = connection.cursor()
cursor.execute("Select * from table_name")
for rows in cursor:
print(rows)
错误:cx_Oracle.DatabaseError:DPI-1047:无法加载64位Oracle客户端库:“ dlopen(libclntsh.dylib,1):找不到映像”。请参见https://oracle.github.io/odpi/doc/installation.html#macos以获取帮助