how to setup cx_Oracle on python – windows [solved]

When trying to use cx_Oracle in python on windows, I faced following error:

>>> import cx_Oracle
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

In my case, oracle instant client was not installed.
Here is how to solve it.


  1. Download and unzip oracle instant client appropriate for your configuration:
    note: on my side i downloaded basic client + odbc + jdbc + sqlplus
  2. Ensure environment variables ORACLE_HOME and PATH points to instant client folder
    note: in windows, go to control panel > System > Advanced system settings > tab “Advanced” > click on “Environment Variables” and define env variables:
  3. Install cx_Oracle client from or for windows
  4. Open a new command window and ensure ORACLE_HOME is pointing to correct folder, by running in windows:
    echo %ORACLE_HOME%
  5. Open python console and “run import cx_Oracle”

It should be successful


Post a Comment

Your email is never published nor shared. You're allow to say what you want...