title: Getting Error Connect to Oracle using Python On Mac - Cannot locate Oracle Client library
body: <p>I'm trying to connect to Oracle database in Python on Mac but getting the following error:</p>
  <p><strong>cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: &quot;dlopen(libclntsh.dylib, 1): image not found&quot;. See
  <a href="https://oracle.github.io/odpi/doc/installation.html#macos" rel="nofollow noreferrer">https://oracle.github.io/odpi/doc/installation.html#macos</a> for help</strong></p>
  <p>The code causing the error is
  dsn_tns = cx_Oracle.makedsn(host='', port='', service_name='')
  conn = cx_Oracle.connect(user='', password='', dsn=dsn_tns)</p>
  <p>Using the cx_Oracle Library</p>
  <p>This is my lib folder</p>
  <p>$ ls -la ~/lib</p>
  <p>total 274272</p>
  <p>drwxr-xr-x    7   staff        224 Jun 25 13:31 .</p>
  <p>drwxr-xr-x+ 113   staff       3616 Jun 25 14:20 ..</p>
  <p>lrwxr-xr-x    1   staff         61 Jun 24 18:03 libclntsh.dylib -&gt; /Users/username/oracle/instantclient_19_3/libclntsh.dylib</p>
  <p>lrwxr-xr-x    1   staff         51 Jun 25 13:31 libclntsh.dylib.19.1 -&gt; /opt/oracle/instantclient_19_1/libclntsh.dylib.19.1</p>
  <p>-rwxr-xr-x@   1   staff    4803832 Jun 24 18:31 libclntshcore.dylib.19.1</p>
  <p>-rwxr-xr-x@   1   staff    8349944 Jun 24 18:30 libnnz19.dylib</p>
  <p>-rwxr-xr-x@   1   staff  125518764 Jun 24 18:31 libociei.dylib</p>
  <p>MacOS: Catalina Version 10.15.5
  Python 3.7.7
  Oracle client</p>