Forum Stats

  • 3,735,092 Users
  • 2,247,105 Discussions


cx_Oracle DLL load failed

744756 Member Posts: 4
edited Feb 1, 2012 10:31PM in Python

I'm struggling with an error "ImportError: DLL load failed: The specified procedure could not be found." when I call import cx_Oracle from python command prompt. I'm using python 3.0 and oracle 11g, for this I installed cx_Oracle 5.0.2( also tried 5.0.1, 5.0, etc) but still getting the same issue.

I don't understand this problem, I have tried all versions in python too, but no use. Could someone help on this isse please.


  • 651761
    651761 Member Posts: 5
    Have you installed Oracle 11g Client?
  • morfeokmg
    morfeokmg Member Posts: 3 Blue Ribbon
    this workarround is functional on windows with cx_oracle2.5.4 and Oracle 10g.

    1.Dentro de la siguiente carpeta {C:\Python25}\Lib\site-packages ({C:\Python25} puede cambiar dependiendo de donde se realizó la instalación). Copiaremos el archivo cx_Oracle.pyd y lo pegamos en la carpeta {C:\Python25}\DLLs
    2.El contenido del archivo oracleForPython.rar (this a set of files of Oracle InstantClient) se extraerá en la carpeta {C:\Python25}\DLLs de la instalación de python.
    3.Posterior a ello la biblioteca de cx_Oracle y las librerías dependientes ya se tendrán instaladas en nuestro PYTHON_PATH respectivo, podremos comprobar que funciona correctamente con el siguiente comando en la consola de cmd:
    a.Cmd <--[INTRO]
    b.PROMPT> Python <-- [INTRO]
    c.>> import cx_Oracle <-- [INTRO]
    d.En este ultimo comando no deberemos de recibir el mensaje de error descrito anteriormente.
  • 783174
    783174 Member Posts: 3
    Hi I am new to this python and Oracle. I am also encountering the same error.
    I wish to connect to a database located on another machine using python from my machine. I dont have Oracle installed on my system but it is there on that remote machine.

    I am also encountering the same error.

    Right now I am using Oracle SQLdeveloper to connect to that database . But I wish to do the same using a python script.

    Can you please help me with this error .

    I have :-

    python :- 2.6.5


    Error which I encounter :-
    import cx_Oracle

    Traceback (most recent call last):
    File "<pyshell#1>", line 1, in <module>
    import cx_Oracle
    ImportError: DLL load failed: The specified procedure could not be found.
  • sun1991
    sun1991 Member Posts: 11
    Suppose you are using windows OS:
    Check your environment variable, make sure Path contains something like "D:\oracle\product\10.2.0\db_1\bin;", and your cx_Oracle matches Oracle 10g.
This discussion has been closed.