Problems importing cx_oracle in python 3.4 64 bits


I have a problem with cx_oracle in python 64 bit. I installed this version of cx_oracle: But when importing in python import cx_Oracle , the following error occurs:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import cx_Oracle
ImportError: DLL load failed: %1 não é um aplicativo Win32 válido.

I found it strange because the file is for 64-bit windows and even then, it complains about not being a 32-bit application. How can I work around this problem?

asked by anonymous 24.05.2016 / 20:03

1 answer


Try to install by pip as you are informed in cx_Oracle page in Source Forge .

pip install cx_Oracle

Pip always checks the Python version when downloading the library. If your Python is 64-bit, it will look for a 64-bit version of the library, and if it does not exist, it will report that there are none available. It is usually safer than installing "manually". Python is full of these discrepancies, so I highly recommend using the pip whenever possible.


As evidenced by in this question , in the case of error Unable to find vcvarsall.bat , open the CMD and use the command with SET corresponding to the version of your Visual Studio (If not, install):

  • Visual Studio 2010 (VS10): SET VS90COMNTOOLS=%VS100COMNTOOLS%
  • Visual Studio 2012 (VS11): SET VS90COMNTOOLS=%VS110COMNTOOLS%
  • Visual Studio 2013 (VS12): SET VS90COMNTOOLS=%VS120COMNTOOLS%
  • Visual Studio 2015 (VS14): SET VS90COMNTOOLS=%VS140COMNTOOLS%
25.05.2016 / 06:26