title: Linux. Connect ot Oracle. cx_Oracle.DatabaseError: DPI-1047 Cannot locate a 64-bit Oracle Client library: "libclntsh.so
body: <p>I have error "cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See <a href="https://oracle.github.io/odpi/doc/installation.html#linux" rel="nofollow noreferrer">https://oracle.github.io/odpi/doc/installation.html#linux</a> for help"</p>
  
  <p>I saw <a href="https://oracle.github.io/odpi/doc/installation.html#oracle-instant-client-zip" rel="nofollow noreferrer">https://oracle.github.io/odpi/doc/installation.html#oracle-instant-client-zip</a> and <a href="https://stackoverflow.com/questions/55823744/how-to-fix-cx-oracle-databaseerror-dpi-1047-cannot-locate-a-64-bit-oracle-cli">How to fix: cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library - Python</a></p>
  
  <p>I always work on Windows and only learing on Linux system. I need help for this issue. Connect to Oracle from python:</p>
  
  <pre><code>import cx_Oracle
  con = cx_Oracle.connect('&lt;USER&gt;/&lt;PASSWORD&gt;@&lt;HOST&gt;:&lt;PORT&gt;/&lt;SID&gt;')
  </code></pre>
  
  <p>I never connected from Linux. It's first time.</p>
  
  <pre><code>user@postgresql:~/opt$ cd oracle
  user@postgresql:~/opt/oracle$ unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
  Archive:  instantclient-basic-linux.x64-12.2.0.1.0.zip
  inflating: instantclient_12_2/adrci  
  inflating: instantclient_12_2/BASIC_README  
  inflating: instantclient_12_2/genezi  
  inflating: instantclient_12_2/libclntshcore.so.12.1  
  inflating: instantclient_12_2/libclntsh.so.12.1  
  inflating: instantclient_12_2/libipc1.so  
  inflating: instantclient_12_2/libmql1.so  
  inflating: instantclient_12_2/libnnz12.so  
  inflating: instantclient_12_2/libocci.so.12.1  
  inflating: instantclient_12_2/libociei.so  
  inflating: instantclient_12_2/libocijdbc12.so  
  inflating: instantclient_12_2/libons.so  
  inflating: instantclient_12_2/liboramysql12.so  
  inflating: instantclient_12_2/ojdbc8.jar  
  inflating: instantclient_12_2/uidrvci  
  inflating: instantclient_12_2/xstreams.jar
  user@postgresql:~$ sudo apt install libaio1
  user@postgresql:/etc/ld.so.conf.d$ sudo nano oracle-instantclient.conf
  user@postgresql:/etc/ld.so.conf.d$ sudo ldconfig
  user@postgresql:/etc/ld.so.conf.d$ sudo export 
  LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH
  </code></pre>
  
  <p>Linux </p>
  
  <pre><code>user@postgresql:~$ cat /proc/version
  Linux version 5.3.0-46-generic (buildd@lgw01-amd64-003) (gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)) #38-Ubuntu SMP Fri Mar 27 17:37:05 UTC 2020
  </code></pre>