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.shthat includesexport ORACLE_HOME=/opt/ora/instantclient_11_2 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOMECreate a file in
/etc/ld.so.conf.d/oracle.confthat includes/opt/ora/instantclient_11_2Execute the following command
sudo ldconfigNote: you may need to reboot to apply settings
-
Create a symlink
cd $ORACLE_HOME ln -s libclntsh.so.11.1 libclntsh.so -
Install
cx_Oraclepython package-
You may install using
pippip 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
-