Cx_Oracle: Distutils.Errors.Distutilssetuperror: Cannot Locate Oracle Include Files

Python 3.5.3 and Oracle 11.2 on Windows 7: cannot locate oracle include files

You will need to install dependencies from Oracle.

  1. Download Installer from here

  2. Add ORACLE_HOME as Windows environment variable and set the path of the unzipped folder e.g. C:\....\Download\instantclient_12_1 as its value. Click here in case you don't know how to add environment variable.

  3. Append this same path to the environment variable Path

  4. pip install cx_oracle

  5. Reboot your computer and start using cx_oracle!

cx_Oracle does not recognize location of Oracle software installation for installation on Linux

Updated

As Petriborg suggested, setting LD_RUN_PATH at build time will include the path to the Oracle shared library files in the cx_Oracle shared library that is built during installation. This obviates the need for LD_LIBRARY_PATH as I suggested in my first answer.


For the RPMs that you are using, ORACLE_HOME should be set to /usr/lib/oracle/12.1/client. If you are using pip:

$ export ORACLE_HOME=/usr/lib/oracle/12.1/client
$ export LD_RUN_PATH=/usr/lib/oracle/12.1/client/lib:$LD_RUN_PATH
$ pip install cx_Oracle
$ python -c 'import cx_Oracle; print(cx_Oracle.version)'
5.1.3

Read this documentation for some info on installing and executing applications that use the client libraries.

error: cannot locate an Oracle software installation When trying to install cx_Oracle

Don't use easy_install or pip, they don't really work very well for installing cx_Oracle since there are a number of environmental dependencies that the install scripts don't set up automatically. You need to get an oracle client driver, the quickest of which to find is the instantclient. Then point your ORACLE_HOME and PATH at the install location for the drivers, and install cx_Oracle itself. You should be good to go after that.

see: easy_install cx_Oracle (python package) on Windows

The question is about windows, but the answer includes info on *nix.

cx_Oracle not installing on Oracle Linux

This tutorial worked like a charm and saved my life: http://ubuntugeeknerd.blogspot.com/2013/08/how-to-install-oxoracle-in-rhel-64-bit.html



Related Topics



Leave a reply



Submit