The alternate way, that doesn’t require RPMs. You need to be root
.
-
Dependencies
Install the following packages:
apt-get install python-dev build-essential libaio1
-
Download Instant Client for Linux x86-64
Download the following files from Oracle’s download site:
-
Extract the zip files
Unzip the downloaded zip files to some directory, I’m using:
/opt/ora/
-
Add environment variables
Create a file in
/etc/profile.d/oracle.sh
that includesexport ORACLE_HOME=/opt/ora/instantclient_11_2 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME
Create a file in
/etc/ld.so.conf.d/oracle.conf
that includes/opt/ora/instantclient_11_2
Execute the following command
sudo ldconfig
Note: you may need to reboot to apply settings
-
Create a symlink
cd $ORACLE_HOME ln -s libclntsh.so.11.1 libclntsh.so
-
Install
cx_Oracle
python package-
You may install using
pip
pip install cx_Oracle
-
Or install manually
Download the cx_Oracle source zip that corresponds with your Python and Oracle version. Then expand the archive, and run from the extracted directory:
python setup.py build python setup.py install
-