CX_Oracle import Error for libclntsh.so.12.1
<p>I have <strong>Oracle 11g</strong> configured in my <code>Ubuntu 16.04</code> and its working perfectly fine.</p>

<p>Previously I tried to install <code>Oracle 12c</code>, which was giving some errors so I removed it and install 11g.</p>

<p>Now, my problem is that when I try to use <code>import cx_Oracle</code> in <code>python</code>, it gives import error for <code>libclntsh.so.12.1</code>.</p>

<p>Here is the whole output:</p>

<pre><code>&gt;&gt;&gt; import cx_Oracle
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
ImportError: libclntsh.so.12.1: cannot open shared object file: No such file or directory
</code></pre>

<p>My .bashrc file has these entries:</p>

<pre><code>export PATH="/home/marvin/anaconda2/bin:$PATH"
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
</code></pre>

<p>Why is it still trying to take <code>Oracle 12c</code>? Is there is some error in 11g configuration or in 12c uninstall?</p>

<p>I have already tried uninstalling and reinstalling <code>cx_oracle</code> via <code>pip</code>.</p>