For Oracle 12.x , cx_Oracle not available yet. So we need to download instant client with 11.x version.
Go to http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html and accept License Agreement.
Then download zip files with names as below
instantclient-sdk-linux.x64-11.2.0.4.0.zip
instantclient-basic-linux.x64-11.2.0.4.0.zip
And unzip them with unzip command
unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip
unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
Both will be extracted into a common directory named as "instantclient_11_2". Then add this to PATH with below commands.
export ORACLE_HOME=/path-to_this/instantclient_11_2
cd $ORACLE_HOME
ln -s libclntsh.so.11.1 libclntsh.so
Open /etc/profile or .bashrc and following entries.
export ORACLE_HOME=/location/of/your/files/instantclient_11_2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME
then do source ~/.bashrc or source /etc/profile
And install these packages
sudo apt-get install build-essential unzip python-dev libaio-dev
after that use pip or pip3 according to your Python version and then install it
pip3 install cx_Oracle
and try loading cx_Oracle module in Python interpreter.
Hope this helps.
Credit goes here: https://gist.github.com/kimus/10012910
Note: I have tried this on my Ubuntu 16.04 installation , it should work for you.