Forum Stats

  • 3,853,873 Users
  • 2,264,288 Discussions


cx_Oracle installation on Windows - silent failure

103122 Member Posts: 16
edited Dec 19, 2009 10:56AM in Python
I just had a surprisingly hard time getting cx_Oracle 5.0.2 installed on a new Vista machine (with Oracle Client, Python 2.6) using the windows .msi installer. Eventually, I managed to get it installed only when all the following were true:

- Running as Administrator
- ORACLE_HOME set in Environment Variables (Computer => Properties => Advanced System Settings). Simply issuing "set ORACLE_HOME=c:\app\product\11.1.0\client_1" from the command prompt does not seem to do it.
- Any previous failed installations must be removed, not simply repaired.

If any of these are not true, the installation still appears to work - the installer runs and completes without complaint. Trying to actually "import cx_Oracle", however, gives

ImportError: No module named cx_Oracle

I'm posting this here because, without an error message from the installer or any mention in the documentation or the README, this seems like the sort of sneaky problem that could make newbie Python users quit in frustration. (Also, I'll be able to find it here myself...)

Edited by: catherinedevlin on Jun 26, 2009 11:50 AM

Edited by: catherinedevlin on Jun 26, 2009 1:50 PM


  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,654 Employee
    Thanks Catherine!
  • 122352
    122352 Member Posts: 401
    Many thanks !

  • 571706
    571706 Member Posts: 20
    Thank you. Your post helped me look in right direction.

    I have
    Windows XP, Python 2.6, Django 1.1, Oracle client 9.2 and 10.2, cx_Oracle 5.0.2 (for Oracle 10) on my computer.

    Issue was i did not have ORACLE_BASE=C:/oracle and ORACLE_HOME=C:\oracle\10.2 defined as env variable.
    Also, the path had both 9.2 and 10.2 defined.

    When i ran server it gave: DLL not found even though it exists. Once i removed all 9.2 entries from my env variables it worked like a charm.

    I am still a newbie and trying to get data out from oracle db using python/django.
  • 730457
    730457 Member Posts: 1
    edited Oct 27, 2009 10:38AM
    I am also trying to use cx_oracle module with python & django. The module installed without any problem but
    while running the server, I am getting following errors
    Validating models...
    Unhandled exception in thread started by <function inner_run at 0x00D17970>
    Traceback (most recent call last):
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\core\management\commands\", line 48, in inner_run self.validate(display_num_errors=True)
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\core\management\", line 249, in validate num_errors = get_validation_errors(s, app)
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\core\management\", line 22, in get_validation_errors from django.db import models, connection
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\db\", line 41, in <module> backend = load_backend(settings.DATABASE_ENGINE)
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\db\", line 17, in load_backend return import_module('.base', 'django.db.backends.%s' % backend_name)
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\utils\", line 35, in import_module __import__(name)
    File "C:\Documents and Settings\tbodha\Desktop\django\Python26\Lib\site-packages\django\db\backends\oracle\", line 25, in <module> raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
    django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle module: DLL
    load failed: The specified procedure could not be found.

    can anybody point me which configuration value, I am missing?

    Thank you.

    Edited by: 3nath on Oct 27, 2009 7:37 AM
  • dbaktiar
    dbaktiar Member Posts: 3
    edited Dec 19, 2009 10:55AM

    I believe that you miss the Visual C++ Runtime library.
    You need it in your system (the .DLL).

    Daniel Baktiar

    Edited by: dbaktiar on Dec 19, 2009 7:55 AM
  • dbaktiar
    dbaktiar Member Posts: 3
    edited Dec 19, 2009 10:56AM
    You might need to install the file: vcredist_x86.exe (or the x64 version) in case you haven't installed the runtime from some other application packages.

    You might be able to download from this site:

    Edited by: dbaktiar on Dec 19, 2009 7:55 AM
This discussion has been closed.