cx_Oracle: ImportError: DLL load failed: This application has failed

RubenGeert picture RubenGeert · Nov 23, 2013 · Viewed 45.3k times · Source

Here's what I did:

  1. I'm on Windows XP SP3
  2. I already had Python 2.7.1 installed.
  3. I downloaded instantclient-basic-nt-11.2.0.3.0.zip, unzipped it, and put it in C:\Program Files\Oracle\instantclient_11_2.
  4. I added this path to the Windows Path environment variable.
  5. I created a new environment variable ORACLE_HOME holding this path as its value.
  6. I installed cx_Oracle-5.1.2-11g.win32-py2.7.msi.

And on running import cx_Oracle all I get is

Traceback (most recent call last): 
  File "<string>", line 2, in <module> 
ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

I obviously uninstalled / reinstalled cx_Oracle a couple of times but really nothing seems to help. Could anyone please provide a clue how to fix this?

UPDATE

I ran Dependency Walker and it comes up with a lot of trouble. However, the first missing .dll (msvcr80.dll) is actually present in C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.91_x-ww_0de56c07.

enter image description here

Answer

RubenGeert picture RubenGeert · Nov 25, 2013

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):

  • Download and unzip version 12 from here.
  • Add "ORACLE_HOME" as a Windows environment variable and set its value to ...\instantclient_12_1, (not its containing folder!).
  • Add this same path to the "Path" environment variable.
  • Only now install cx_Oracle.