Skip to content

Instantly share code, notes, and snippets.

@dkaranja
Last active October 31, 2018 07:43
Show Gist options
  • Save dkaranja/9df6ca71cd10ac0cd911e3f733f0f498 to your computer and use it in GitHub Desktop.
Save dkaranja/9df6ca71cd10ac0cd911e3f733f0f498 to your computer and use it in GitHub Desktop.
Installing cx_Oracle on Mac OS
https://oracle.github.io/odpi/doc/installation.html#macos
In case this link doens't work
To run ODPI-C applications with Oracle Instant Client zip files:
Download the 18, 12, or 11.2 “Basic” or “Basic Light” zip file from https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html. Choose either a 64-bit or 32-bit package, matching your application architecture. Most applications use 64-bit.
Unzip the package into a single directory that is accessible to your application. For example:
mkdir -p /opt/oracle
unzip instantclient-basic-macos.x64-12.2.0.1.0.zip
Add links to $HOME/lib or /usr/local/lib to enable applications to find the library. For example:
mkdir ~/lib
ln -s /opt/oracle/instantclient_12_2/libclntsh.dylib.12.1 ~/lib/
Alternatively, copy the required OCI libraries. For example:
mkdir ~/lib
cp /opt/oracle/instantclient_12_2/{libclntsh.dylib.12.1,libclntshcore.dylib.12.1,libons.dylib,libnnz12.dylib,libociei.dylib} ~/lib/
For Instant Client 11.2, the OCI libraries must be copied. For example:
mkdir ~/lib
cp /opt/oracle/instantclient_11_2/{libclntsh.dylib.11.1,libnnz11.dylib,libociei.dylib} ~/lib/
If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.ora or oraaccess.xml with Instant Client, then create a network/admin subdirectory, if it does not exist. For example:
mkdir -p /opt/oracle/instantclient_12_2/network/admin
This is the default Oracle configuration directory for applications linked with this Instant Client.
Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMIN to that directory name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment