Oracle connection : add ORACLE_DB_LIB to use a compatible client
Closed this issue · 8 comments
I have a 64bit python on my windows pc and a 32bit Oracle client
So to use Oracle connection with python, I have to use a 64bit client and put the OCI.dll in another path
If I let 32bit client, I got
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library
Could it be possible to add ORACLE_DB_LIB in Oracle connection and use it like this in Oracle input :
ORACLE_DB_LIB= os.getenv('ORACLE_DB_LIB')
cx_Oracle.init_oracle_client(lib_dir=ORACLE_DB_LIB)
Thanks @amoradell, I'll take a look.
Also adding this for reference: https://stackoverflow.com/questions/56119490/cx-oracle-error-dpi-1047-cannot-locate-a-64-bit-oracle-client-library
I'll add the option as optional, curious, would deleting the 32bit client be a solution if you only have the 64bit installed?
Added the field in 0.5.72, let me know if that works.
By the way, you can use Env. Variables using the Env. Variables component.
32bit client is on the Path and mandatory for my others programs
I can't delete it so I use env variable and pass to cx_Oracle
By the way, why SQLAlchemy use cx_Oracle instead of python-oracledb ?
cx_Oracle last version is 8.3 (11/2021) and python-oracledb is currently developed (2.4)
It's ok in 0.5.72, thanks
@amoradell, thanks for flagging this, I actually chose the first one showing up in SQL Alchemy's doc. I see now that python-oracledb might be the better path forward. I'll look into it (#107).
Thank you
@amoradell FYI, I added the DBAPI oracledb in latest version, (cx_Oracle is still available but is not used by default).