So I found Help installing cx_Oracle but am still stuck. I downloaded the latest instantclient from oracle, and set ORACLE_HOME to the location of the extracted files (both direct and with a bin folder between the ORACLE_HOME value and the files), but easy_install is popping an error when running setup.py saying it can’t locate the Oracle include files. I did notice that only the 11g dll is in the folder, do I need all 3 drivers present for setup to complete? If so, where do I even get them?
Share
Honestly it is a hell of a lot easier to install cx_Oracle from one of the binary installers they have, than from source.
HOWTO for *nix:
Browse to Instant Client for Linux x86 download page.
Download the latest version of basic, sqlplus and sdk packages that fit your architecture (32 or 64bits):
oracle-instantclient<version>-basic-<version_full>.<arch>.rpmoracle-instantclient<version>-sqlplus-<version_full>.<arch>.rpmoracle-instantclient<version>-devel-<version_full>.<arch>.rpm.Install the RPMs using alien. For example, at the time of this writing:
Add necessary environment variables (I personally did put it in
/etc/environmentthen logoff/back in to reload the env):Fix oracle’s includes:
Create
/etc/ld.so.conf.d/oracle-instantclient<version>-basic.confand/etc/ld.so.conf.d/oracle.conf(for more recent versions, at least since 12.1) containing:Reload ldconfig cache (use
-vflag if you want some verbose):You might need to install
libaio1.HOWTO Install cx_Oracle
Assuming we have installed Oracle Instant Client 10, you have different alternatives to install cx_Oracle:
$ pip install cx_oracle(linux only)Older versions (version less than 5.1.2 are .msi and .rpm files) can be downloaded from here. Install the RPMs using alien. For example, at the time of this writing:
$ sudo alien -i cx_Oracle-5.0-10g-py25-1.x86.rpmTo test,
python -c 'import cx_Oracle; print cx_Oracle'should return the modules with its version.