Environment:
Win7 32-bit system
Python3.6 (32bit)
Installation module:
Cx_oracle module Download (: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_oracle)
If it is downloaded on the website, it is necessary to download and the Python version corresponds . Because I used to cx_oracle-5.3+oci12c-cp36-cp36m-win_amd64.whl this file when I installed the 64-bit system, Therefore, this installation will download the corresponding 32-bit system CX_ORACLE?5.3+OCI12C?CP36?CP36M?WIN32.WHL.
Using the PIP install path installation, path is where the file is located
Oracle Client Instantclient_12_1 (: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)
Because the cx_oracle file is downloaded cx_oracle?5.3+oci12c? CP36?CP36M?WIN32.WHL, corresponding to the 32-bit version of 12
Copy the Oci.dll Oraociei12.dll and oraocci12.dll three files from the downloaded instantclient-basic-nt-12.1.0.2.0 file to the Python installation path (for example, my own D:\soft\ Python36\lib\site-packages).
Problem
Run in Idle
1 Import cx_oracle
Error:importerror:dll load failed: The specified module could not be found
This problem occurs because there is no copy of the Oci.dll file mentioned earlier or the Oracle client version is inconsistent with the cx_oracle version
And I have copied the Oci.dll file. And the file name is judged to be the same version.
I tested all 12 versions of the Oracle client, including 64-bit, without success. (Error when testing 64-bit:importerror: DLL load failed:%1 is not a valid WIN32 application , which means the operating system, CX_ Oracle and Instantclient are different in number of bits, but there was no other way to try.
Then I realized that maybe it was the cx_oracle problem ...
Solutions
Run in cmd
Pip Install-u cx_oracle
Update the Cx_oracle module to the latest version, problem solving.
Python installation cx_oracle module problems (32bit)