2
import pandas as pd
import sqlalchemy

engine = sqlalchemy.create_engine('oracle://XXX:XXX@XXX:XXX/?service_name=XXX')

sql = 'select * from XXX where rownum < 10'
df = pd.read_sql(sql,con=engine)

DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: 64-bit Oracle Client library cannot be loaded: "C:\oracle\11.2.0\bin\oci.dll is not the correct architecture". See https://oracle.github.io/odpi/doc/installation.html#windows for help

I am trying to connect to an Oracle database using Python but I am receiving the above error. I know that:

  1. I have set the path to look at the correct location - it is shown in the error.
  2. Python is 64 bit.
  3. The bin folder location contains both a 32 bit (ociw32.dll) and a 64 bit (oci.dll) file.

Yet the error still tells me the architecture is wrong.

Any help on this would be great - I can't figure out where the issue might be!

rgettman
  • 176,041
  • 30
  • 275
  • 357
Colin O'Brien
  • 23
  • 1
  • 4

1 Answers1

1

The file mentioned in the error message is a 32-bit DLL, not a 64-bit DLL -- at least assuming the logic that checks such things is correct! The code is making use of the imagehelp API mentioned here: How can I test a Windows DLL file to determine if it is 32 bit or 64 bit?. There are a few other ways to verify that the DLL is 32-bit or 64-bit as well. Check your PATH and ensure that a 64-bit Oracle Client installation is first in the PATH. Download and unzip a 64-bit Oracle Instant Client for quick and easy testing.

Anthony Tuininga
  • 6,388
  • 2
  • 14
  • 23