Python Forum

Full Version: Unable to connect oracle database using python code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm getting below error while trying to connect oracle database in python code. could someone help:

>>> import cx_Oracle
>>> connection = cx_Oracle.connect('system/welcome123@orcl')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: DPI-1047: 32-bit Oracle Client library cannot be loaded: "C:\app\mayugupt\product\12.1.0\dbhome_1\bin\oci.dll is not the correct architecture". See https:/
/oracle.github.io/odpi/doc/installation.html#windows for help
>>>
>>>
Error messages should be interpreted -- That's what they are there for.

Quote:wrong dll: C:\app\mayugupt\product\12.1.0\dbhome_1\bin\oci.dll is not the correct architecture
see: https://oracle.github.io/odpi/doc/instal...ml#windows

And on that site:

Quote:ODPI-C requires Oracle Client libraries, which are found in Oracle Instant Client, or an Oracle Database installation, or in a full Oracle Client installation. The libraries must be either 32-bit or 64-bit, matching your application and ODPI-C library (if one is created separately).

On Windows, ODPI-C searches for the Oracle Client library “OCI.dll” using the standard library search order.

Oracle Client libraries require the presence of the correct Visual Studio redistributable.

11.2 : VS 2005 64-bit or VS 2005 32-bit
12.1 : VS 2010
12.2 : VS 2013
the last bunch of fields are links, most likely what you need to download and install.
Thanks for your help !!