'cx_Oracle connection fails with 'DPI-1047: Cannot locate a 64-bit Oracle Client library'
Problem use connection oracle to python source, oracle now is worked to other language php (oci)
Error:
Traceback (most recent call last):
File "c:\xampp\htdocs\pyoracle\testConnectionOracle.py", line 4, in <module>
conn = cx_Oracle.connect('xxx','xxx', dsn_tns,'UTF-8')
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "failed to get message for Windows Error 126". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help
Code:
import cx_Oracle
dsn_tns = cx_Oracle.makedsn('192.168.1.217', '1521', service_name='xx')
conn = cx_Oracle.connect('xx','xx', dsn_tns,'UTF-8')
c = conn.cursor()
c.execute('select * from database.table')
for row in c:
print (row[0], '-', row[1])
conn.close()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
