0

import cx_Oracle Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: %1 is not a valid Win32 application.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

I'll list the things that you need to check.

1) An Oracle client is required. The easiest to use is the Oracle instant client which you can get from this location: http://www.oracle.com/technetwork/database/features/instant-client/index.html

2) If Python is 64-bit, the Oracle client needs to be 64-bit and cx_Oracle needs to be 64-bit. If Python is 32-bit, the Oracle client needs to be 32-bit and cx_Oracle needs to be 32-bit. You can't mix and match!

3) The client needs to be in the PATH environment variable. No other environment variables (like ORACLE_HOME) should be set.

You can use the "depends" tool (http://www.dependencywalker.com/) to help determine why Windows is refusing to load that DLL.

Anthony Tuininga
  • 6,388
  • 2
  • 14
  • 23
  • In 2) you may want a 32-bit Oracle client to go with Python 32-bit. (The current text reads: ... the Oracle client needs to be 64-bit ...) – M. Wymann Oct 04 '16 at 15:28
  • Every software i am using is 64 bit.i had copyd oracle client in my python35 folder and provide path in env variable.but still getting same error again and again –  Oct 05 '16 at 05:26
  • I have also added information about "depends" which can help you figure out what the problem is. – Anthony Tuininga Oct 05 '16 at 12:59