Here\'s what I did:
instantclient-basic-nt-11.2.0.3.0.zip
OK, what finally solved the problem (not sure whether all steps are necessary and no idea why exactly this and only this worked so far):
Steps I have followed :
Downloaded the smart client instantclient-basic-windows.x64-12.1.0.2.0.zip
Extracted and copied to #your directory#\instantclient_12_1
Above directory contains dll's
Append the PATH variable with #your directory#\instantclient_12_1 and created env variable ORACLE_HOME= #your directory#\instantclient_12_1
Download and install cx_Oracle-5.2.1-11g.win-amd64-py2.7.exe
Open idle type import cx_Oracle
if you're using Anaconda on Windows try:
conda install cx_oracle
on your cmd
-> this
To help other people with the same problem:
This error tells about 32-64 bit mismatch between some DLL while importing module. Possibilities are:
Keep in mind that cx_Oracle uses standart Oracle client (at OCI level) which must be installed on your machine. It searches for oci.dll in several places, including PATH. If it founds oci.dll of wrong version of client the error appears.
In case you get this error check path list in the PATH environment variable. It is likely to contain path to BIN folder of wrong version of Oracle client. If you have several clients, specify in the PATH the appropriate one or install appropriate client.
NOTE: ORACLE_HOME does not have an effect for cx_Oracle. In my case only changing of PATH helped. I think the Ruben's solution works because of item 3 ('Add this same path to the "Path" environment variable').
Easy way:
cx_Oracle-5.1.3-11g.win32-py2.7.exe
instantclient_12_1
and move it to C:\Python27
C:\Python27\instantclient_12_1
Same ImportError
occured for setup of:
I solved it copying msvcr100.dll
file into <oracle_instant_client_dir>