Trying to install psycopg2 using pip 19.1 on MacOS 10.14.4 returns the lengthy error message below. I understand there are warnings related to gcc, but given the actual error me
I had this problem running pip install psycopg2
while I was running OSX 10.14.4
. I fixed it by:
Running pg_config
and noticed the variable:
CPPFLAGS = -I/usr/local/Cellar/icu4c/63.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2
However /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
did not exist on my machine.
So I changed it to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
I ran these two commands:
export CPPFLAGS="-I/usr/local/Cellar/icu4c/63.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.sdk -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2"
pip install psycopg2