I recently installed cx_Oracle module on my machine, in order to connect to a remote Oracle database server. (I have no Oracle client at my side).
Then everytime I run my script, it fails and print the following message:
ImportError: DLL load failed: The specified module could not be found.
I found a related post at Here, so I am wondering if I anyway have to have an Oracle client at my side where the python script is invoked.
Can anyone help me out? Thanks in advance.
# - This import requires appropriate oraocciXX.dll to be available in PATH (on windows)
# (Probably LD_LIBRARY_PATH or LD_LIBRARY_PATH64 on POSIX)
# where XX is the oracle DB version, e.g. oraocci11.dll for Oracle 11g.
# - This dll is part of the Oracle Instant client pkg available here:
# http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
# - Also ensure that python, cx_Oracle and Oracle Client are of same arch (32 or 64-bit)
#
import cx_Oracle
You can find out arch (32 or 64-bit) for:
dumpbin /headers oraocciXX.dll
file oraocciXX.so
Finally if you still don't understand here is really for dummies instructions:
C:\ProgFiles\OraClient\11_2
set PATH=%PATH%;C:\ProgFiles\OraClient\11_2
export LD_LIBRARY_PATH=/path/to/your/32bit/oraocciXX.so
export LD_LIBRARY_PATH64=/path/to/your/64bit/oraocciXX.so
path-to-python/python.exe -c "import cx_Oracle"
to test whether your setup is working or not.
ImportError: DLL load failed: The specified module could not be found
: then oraocciXX is not found. Setup the env vars correctly.ImportError: DLL load failed: %1 is not a valid Win32 application
: You have a 32/64 bit mismatch.