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

前端 未结 12 1305
清歌不尽
清歌不尽 2020-12-06 01:11

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
12条回答
  •  没有蜡笔的小新
    2020-12-06 01:42

    To help other people with the same problem:

    This error tells about 32-64 bit mismatch between some DLL while importing module. Possibilities are:

    1. Different architecture of Python and cx_Oracle (less probable since cx_Oracle installer on Windows warns you if appropriate Python was not found).
    2. Different architecture of cx_Oracle libraries and oci.dll (more probable).

    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').

提交回复
热议问题