Skip to content Skip to sidebar Skip to footer

Cx_Oracle - DLL Load Failed: %1 Is Not A Valid Win32 Application. Python

I have: win 7 (64 bit) python 3.4 oracle 64 bit After I downloaded and installed from here the cx_Oracle and try to run this code: import cx_Oracle as cx_Oracle connection = cx_

Solution 1:

please check your Oracle client is 32 or 64 bit version. you will get this error if you have Oracle client 32 bit version is installed, but Python, and modules are in 64 bit.

so you may need to install 64 bit version of oracle client.


Solution 2:

I had same issue and I have solved it by trying many other suggestions found in internet and I came up with list of steps which could solve this issue.

  1. Uninstalled your python and cx_Oracle package
  2. Removed temporary files(press windows button and 'r' to open Run window -> type "%temp%" in Run window and press enter)
  3. Restarted your machine(recommended)
  4. Installed python 2.7.15(64-bits) and verified PATH in environment variables for Python and site-packages
  5. Upgraded pip(python -m pip install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org -U pip)
  6. Installed cx_Oracle using pip(pip install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org cx_Oracle)

Note: If you get "error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27", download and install "Microsoft Visual C++ Compiler for Python 2.7" from "https://www.microsoft.com/en-us/download/details.aspx?id=44266" and repeat Step 6 again.

If you get " error: command 'C:\Users\{username}\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe' failed with exit status 1120 ", install Windows GCC (MinGW) binaries for Python developers from "https://github.com/develersrl/gccwinbinaries/releases/download/v1.1/gcc-mingw-4.3.3-setup.exe" and repeat Step 6 again.

OR

You can uninstall 64-bits version and install 32-bit version.


Post a Comment for "Cx_Oracle - DLL Load Failed: %1 Is Not A Valid Win32 Application. Python"