title: Xcode: 'ModuleNotFoundError: No module named 'psycopg2'
body: <p>I am using Mac OS Catalina Version 10.15.2 and Xcode Version 11.3.
  After some issues I managed to install psycopg2 with the help of this post: <a href="https://stackoverflow.com/questions/59493078/python-3-7-psycopg2-xcode-error-error-command-gcc-failed-with-exit-status/59517003#59517003">Python 3.7 psycopg2 - Xcode Error &quot;error: command &#39;gcc&#39; failed with exit status 1&quot;</a></p>
  
  <p>Psycopg2 was required since I am developing an application using Python 3.7, Kivy and a PostgreSQL (12) database, which I want to run on my iPhone. Using PyCharm, the preview/ GUI runs without any problems. Also the database access, queries and the import of psycopg2 works without any problems. For my project I have 2 .py files (main.py and queries.py). </p>
  
  <p>I installed psycopg2 using <code>pip3 install psycopg2==2.7.7</code> and <code>pip3 install psycopg2-binary</code>, since I am also working with Python 3.7 for the project. I installed version 2.7.7 since version 2.8.4 of psycopg2 did cause several other issues, which did not even let me run the project in PyCharm.</p>
  
  <p>When I now try to build the application using Xcode it does show me "Build succeeded" but then crashes with the error code <strong>'ModuleNotFoundError: No module named 'psycopg2'</strong>.</p>
  
  <p>If I try to install psycopg2 again it does tell me that it is already installed</p>
  
  <pre><code>Jans-MBP:~ jang$ pip3 install psycopg2==2.7.7
  Requirement already satisfied: psycopg2==2.7.7 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (2.7.7)
  </code></pre>