Django.fun

Error when pushing app to Heroku (psycopg2 error)

I am trying to git push my heroku app and when I execute the following command git push heroku master I get the error below. I have tried brew install postgresql, reinstalling psycopg2, installing psycopg2-binary. I have been searching for a solution and trying various ones but none seem to working. I am not too familiar with psycopg2 to know what the exact problem is so I would appreciate any help. My code is below thank you!

Enumerating objects: 107, done.
Counting objects: 100% (107/107), done.
Delta compression using up to 4 threads
Compressing objects: 100% (104/104), done.
Writing objects: 100% (107/107), 17.72 MiB | 1.82 MiB/s, done.
Total 107 (delta 15), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/heroku/heroku-buildpack-python.git
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.9.9
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.9
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting asgiref==3.4.1
remote:          Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)
remote:        Collecting dj-database-url==0.5.0
remote:          Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB
remote:        Collecting Django==3.2.10
remote:          Downloading Django-3.2.10-py3-none-any.whl (7.9 MB)
remote:        Collecting django-heroku==0.3.1
remote:          Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote:        Collecting gunicorn==20.1.0
remote:          Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
remote:        Collecting psycopg2==2.7.7
remote:          Downloading psycopg2-2.7.7.tar.gz (427 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting psycopg2-binary==2.9.3
remote:          Downloading psycopg2_binary-2.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
remote:        Collecting pytz==2021.3
remote:          Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
remote:        Collecting sqlparse==0.4.2
remote:          Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)
remote:        Collecting typing_extensions==4.0.1
remote:          Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
remote:        Collecting whitenoise==5.3.0
remote:          Downloading whitenoise-5.3.0-py2.py3-none-any.whl (19 kB)
remote:        Building wheels for collected packages: psycopg2
remote:          Building wheel for psycopg2 (setup.py): started
remote:          Building wheel for psycopg2 (setup.py): finished with status 'error'
remote:          ERROR: Command errored out with exit status 1:
remote:           command: /app/.heroku/python/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qc3c9xfl/psycopg2_426c019d4d8c43b995ec3618b90fcd0d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qc3c9xfl/psycopg2_426c019d4d8c43b995ec3618b90fcd0d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-nbbgfqsp
remote:               cwd: /tmp/pip-install-qc3c9xfl/psycopg2_426c019d4d8c43b995ec3618b90fcd0d/
remote:          Complete output (86 lines):
remote:          running bdist_wheel
remote:          running build
remote:          running build_py
remote:          creating build
remote:          creating build/lib.linux-x86_64-3.9
remote:          creating build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/psycopg1.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          creating build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_green.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_cursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_transaction.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_notify.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/testconfig.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_copy.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_replication.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_sql.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_quote.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_connection.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_module.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/testutils.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_dates.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_async.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_with.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_lobject.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_cancel.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          Skipping optional fixer: buffer
remote:          Skipping optional fixer: idioms
remote:          Skipping optional fixer: set_literal
remote:          Skipping optional fixer: ws_comma
remote:          running build_ext
remote:          building 'psycopg2._psycopg' extension
remote:          creating build/temp.linux-x86_64-3.9
remote:          creating build/temp.linux-x86_64-3.9/psycopg
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_binary.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_binary.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_datetime.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_list.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pboolean.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pfloat.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pint.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_qstring.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-3.9/psycopg/bytes_format.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-3.9/psycopg/connection_int.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-3.9/psycopg/connection_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_int.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/diagnostics_type.c -o build/temp.linux-x86_64-3.9/psycopg/diagnostics_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/error_type.c -o build/temp.linux-x86_64-3.9/psycopg/error_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/green.c -o build/temp.linux-x86_64-3.9/psycopg/green.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/libpq_support.c -o build/temp.linux-x86_64-3.9/psycopg/libpq_support.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/lobject_int.c -o build/temp.linux-x86_64-3.9/psycopg/lobject_int.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/lobject_type.c -o build/temp.linux-x86_64-3.9/psycopg/lobject_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/microprotocols.c -o build/temp.linux-x86_64-3.9/psycopg/microprotocols.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-3.9/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-3.9/psycopg/notify_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-3.9/psycopg/pqpath.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=140001 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.9/psycopg/psycopgmodule.o -Wdeclaration-after-statement
remote:          psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
remote:          psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
remote:            689 |     while (interp->next)
remote:                |                  ^~
remote:          error: command '/usr/bin/gcc' failed with exit code 1
remote:          ----------------------------------------
remote:          ERROR: Failed building wheel for psycopg2
remote:          Running setup.py clean for psycopg2
remote:        Failed to build psycopg2

Answers: 1

Answered by Chris, Jan. 13, 2022, 6:04 a.m.

You appear to be depending on psycopg2 and psycopg2-binary.

The whole point of psycopg2-binary is so you don't have to build psycopg2 from source. Remove psycopg2 from your requirements.txt, commit, and redeploy.