title: Installing psycopg2 fails completely. Huge error message (such as error: command 'gcc' failed with exit status 1)
body: <p>I have a problem with installing <code>psycopg2</code> on my mac. I tried several things such as installing it with <code>pip</code> and also homebrew. I also downloaded all dependencies but it still fails to install it. </p>
  
  <p>I get the following error message, which looks horrifying:</p>
  
  <pre><code>Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1c/nhs40gy513143dfqyblmt3r80000gn/T/pip-install-rxlPem/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/1c/nhs40gy513143dfqyblmt3r80000gn/T/pip-record-93LksX/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1c/nhs40gy513143dfqyblmt3r80000gn/T/pip-install-rxlPem/psycopg2/
  </code></pre>
  
  <p>What could be the issue? </p>
  
  <p><strong>EDIT:</strong> Full error can be found <a href="https://pastebin.com/yL3BzJeG" rel="nofollow noreferrer">here</a>, and this appears to be the most relevant part:</p>
  
  <pre><code>clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.sdk' [-Wmissing-sysroot]
  In file included from psycopg/psycopgmodule.c:27:
  In file included from ./psycopg/psycopg.h:34:
  /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:25:10: fatal error: 'stdio.h' file not found
  #include &lt;stdio.h&gt;
           ^~~~~~~~~
  1 error generated.
  </code></pre>