title: I am unable to import psycopg2 from Jupyter notebook or Jupyter Lab on Mac. I have a clean install of Catalina
body: <p>A similar report was posted, but the suggested solutions do not work. </p>
  
  <pre><code>---- from Jupyter ----
  
  Import psycopg2
  ModuleNotFoundError                       Traceback (most recent call last)
  &lt;ipython-input-2-7d2da0a5d979&gt; in &lt;module&gt;
  ----&gt; 1 import psycopg2
  
  ModuleNotFoundError: No module named 'psycopg2'
  </code></pre>
  
  <p>If I run <code>python3</code> from Mac terminal and then <code>import psycopg2</code> that works.
  If I run <code>python3</code> from Jupyterlab terminal this does not work. I get the following error after running <code>import pyscopg2</code></p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 50, in &lt;module&gt;
      from psycopg2._psycopg import (                     # noqa
  ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Library not loaded: @rpath/libssl.1.1.dylib
    Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
    Reason: image not found
  </code></pre>
  
  <p><code>echo $PATH</code> from Mac terminal is</p>
  
  <pre><code>/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  </code></pre>
  
  <p><code>echo $PATH</code> from Jupyterlab terminal is</p>
  
  <pre><code>/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin
  </code></pre>
  
  <p>These look the same, just in a different order.</p>
  
  <p>I have tried <code>pip install psycopg2</code> both with and without the binary option.Either way, it says already satisfied.
  I have tried      </p>
  
  <pre><code>conda install -c anaconda psycopg2
  </code></pre>
  
  <p>Also tried installing postgresql both from the postgresql.org, and <code>brew install psycopg2</code>. Both worked, but no luck with Jupyterlab. </p>