安裝報無權限,加user參數:pip install cx-Oracle --user
報錯1:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "dlopen(libclntsh.dylib, 1): image not found". See https://oracle.github.io/odpi/doc/installation.html#macos for he
解決:按提示進入官網https://oracle.github.io/odpi/doc/installation.html#macos
def query():
conn = cx_Oracle.connect(db_connect_link)
cursor = conn.cursor()
cursor.execute("SELECT ID, TOKEN FROM ******")
row = cursor.fetchone()
cursor.close()
conn.close()
return row[0], row[1]
db_connect_link:user_name/password@ip:port/server_name