Skip to content

Instantly share code, notes, and snippets.

@julia3
Last active February 9, 2016 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julia3/768474fee38926f63768 to your computer and use it in GitHub Desktop.
Save julia3/768474fee38926f63768 to your computer and use it in GitHub Desktop.
Install ox_oracle on Mac (Yosemite)

ox_Oracle is a python module that allows developers to connet to Oracle Database. Although The installation process is messy process, we'll try to make it simple for you.

 

Create a directory /usr/lib/share/oracle Download the necessary zip files from here:

  • instantclient-basic-macosx
  • instantclient-sdk-macosx

Unzip both files at the same location, /usr/lib/share/oracle

All the files is uncompressed in dicrectroy instantclient_11_2, sdk should be unzipped in a subdirectory.

For ease of use, set $ORACLE_HOME to this directory:

export ORACLE_HOME=/usr/lib/share/oracle/instantclient_11_2

Create a symlink to you SO file. (Note: Make sure the version number might be different.)

cd $ORACLE_HOME
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib

Update path:

export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME

Finally, install cx_oracle with pip:

pip install cx_oracle

 

References:

Installing cx_Oracle for Python/ Mac OSX. Retrieved from https://gist.github.com/neara/f9b41fcf19b5f25ccd30#file-cx_oracle_instructions-md

Installing python cx_oracle on Ubuntu. Retrieved from https://gist.github.com/kimus/10012910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment