0

I am trying to install requirements on a Django project but I get this error. I've tried almost everything I saw but still no luck.

I have tried pip install -r requirements.txt, pip install psycopg2, pip install psycopg2-binary but none of them worked.

My Python version is 3.9.0 and I've also tried it with 3.8.2 but still got the same error.

Here is the stack trace:

...
    1 warning generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/Users/burakakyalcin/Projects/hakko_api/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o
        gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_asis.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_binary.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_datetime.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_list.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pboolean.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pdecimal.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pfloat.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pint.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_qstring.o build/temp.macosx-10.9-x86_64-3.9/psycopg/aix_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/bytes_format.o build/temp.macosx-10.9-x86_64-3.9/psycopg/column_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/conninfo_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/diagnostics_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/error_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/green.o build/temp.macosx-10.9-x86_64-3.9/psycopg/libpq_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols_proto.o build/temp.macosx-10.9-x86_64-3.9/psycopg/notify_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/pqpath.o build/temp.macosx-10.9-x86_64-3.9/psycopg/psycopgmodule.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_message_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/solaris_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/typecast.o build/temp.macosx-10.9-x86_64-3.9/psycopg/utils.o build/temp.macosx-10.9-x86_64-3.9/psycopg/win32_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.9/psycopg2/_psycopg.cpython-39-darwin.so
        ld: library not found for -lssl
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        error: command '/usr/bin/gcc' failed with exit code 1
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /Users/burakakyalcin/Projects/hakko_api/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/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/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-record-ccaezx4n/install-record.txt --single-version-externally-managed --compile --install-headers /Users/burakakyalcin/Projects/hakko_api/venv/include/site/python3.9/psycopg2 Check the logs for full command output.
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Burak Akyalçın
  • 302
  • 5
  • 26

0 Answers0