Go to - https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
Download instantclient-basic
and instantclient-sdk
appropriate version.
For Example,
- instantclient-basic-macos.x64-12.1.0.2.0.zip
- instantclient-sdk-macos.x64-12.1.0.2.0.zip
Note : You need to Accept License Agreement to download these files.
(Assuming downloaded files are in ~/Downloads
directory)
mkdir ~/oracle
cd ~/oracle
unzip ~/Downloads/instantclient-basic-macos.x64-12.1.0.2.0.zip
#copy sdk folder in ~/oracle/instantclient_12_1 directory
cd ~/Downloads
unzip ~/Downloads/instantclient-sdk-macos.x64-12.1.0.2.0.zip
mv ~/Downloads/instantclient_12_1/* ~/oracle/instantclient_12_1
vi ~/.bash_profile
Add this line
export ORACLE_HOME=~/oracle/instantclient_12_1
export PATH=$ORACLE_HOME:$PATH
cd $ORACLE_HOME
ln -s libclntsh.dylib.12.1 libclntsh.dylib
Type ls -ltr
to ensure that link is added.
pip install cx_Oracle==5.3
Error : distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation
Solution: Export ORACLE_HOME
Error: distutils.errors.DistutilsSetupError: cannot locate Oracle include files
Solution: Add link lib