I have a python script, and keep running into an error when trying to install a package.
I'm using pip 20.2.4 and python 3.7.7, on a MacOS Pro Catalina 10.15.7.
When I run pip install -r requirements.txt, it gets the below error. Any ideas on how to fix this?
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2, psycopg2-binary
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/IdeaProjects/up/grafana/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/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/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-record-984vc1rq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/me/IdeaProjects/up/grafana/env/include/site/python3.7/psycopg2
cwd: /private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/
Complete output (151 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/psycopg2
...
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/psycopg
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework
...
I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/pqpath.c -o build/temp.macosx-10.14-x86_64-3.7/psycopg/pqpath.o
psycopg/pqpath.c:138:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
^~~~~~~~~~~~~~~~~~~~~~
psycopg/pqpath.c:1717:11: warning: code will never be executed [-Wunreachable-code]
ret = 1;
^
psycopg/pqpath.c:1822:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(curs->conn->pgconn) : PQresultStatus(curs->pgres)));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -
...
I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols_proto.c -o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols_proto.o
In file included from psycopg/microprotocols_proto.c:28:
In file included from ./psycopg/psycopg.h:38:
./psycopg/config.h:82:13: warning: unused function 'Dprintf' [-Wunused-function]
static void Dprintf(const char *fmt, ...) {}
^
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g ...
L/usr/local/opt/sqlite/lib -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/me/IdeaProjects/up/grafana/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/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/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-record-984vc1rq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/me/IdeaProjects/up/grafana/env/include/site/python3.7/psycopg2 Check the logs for full command output.