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

前端 未结 12 1267
清歌不尽
清歌不尽 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:34

    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.
    0 讨论(0)
  • 2020-12-06 01:34

    Steps I have followed :

    1. Downloaded the smart client instantclient-basic-windows.x64-12.1.0.2.0.zip

    2. Extracted and copied to #your directory#\instantclient_12_1

      Above directory contains dll's

    3. Append the PATH variable with #your directory#\instantclient_12_1 and created env variable ORACLE_HOME= #your directory#\instantclient_12_1

    4. Download and install cx_Oracle-5.2.1-11g.win-amd64-py2.7.exe

    5. Open idle type import cx_Oracle

    0 讨论(0)
  • 2020-12-06 01:37

    if you're using Anaconda on Windows try:

    conda install cx_oracle
    

    on your cmd

    -> this

    0 讨论(0)
  • 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').

    0 讨论(0)
  • 2020-12-06 01:42

    Easy way:

    • Make sure you have installed cx-Oracle, I have cx_Oracle-5.1.3-11g.win32-py2.7.exe
    • Download, unzip instantclient_12_1 and move it to C:\Python27
    • Add environment variable C:\Python27\instantclient_12_1
    • Restart your computer
    0 讨论(0)
  • 2020-12-06 01:45

    Same ImportError occured for setup of:

    • Windows 10 x64
    • Oracle Instant Client 12_1 x64
    • Python 2.7.11 x64
    • cx_Oracle cx_Oracle-5.2-12c.win-amd64-py2.7

    I solved it copying msvcr100.dll file into <oracle_instant_client_dir>

    0 讨论(0)
提交回复
热议问题