garethbjohnson / gutendex

Web API for Project Gutenberg ebook metadata
https://gutendex.com
MIT License
236 stars 48 forks source link

I got error installing the package in ubuntu server #38

Open arifirfan06 opened 10 months ago

arifirfan06 commented 10 months ago

CASE: Im following the guide until the step 4 during installing requirements.txt


  Building wheel for psycopg2 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [89 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/psycopg1.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-3.10/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-3.10/psycopg2
      creating build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_cancel.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_lobject.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/testconfig.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_copy.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_transaction.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_green.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_connection.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_async.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_notify.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_quote.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_sql.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/dbapi20.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_replication.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_cursor.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/testutils.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_dates.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_with.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/test_module.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      copying tests/__init__.py -> build/lib.linux-x86_64-3.10/psycopg2/tests
      Skipping optional fixer: buffer
      Skipping optional fixer: idioms
      Skipping optional fixer: set_literal
      Skipping optional fixer: ws_comma
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/psycopg
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_asis.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_binary.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_binary.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_datetime.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_list.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pboolean.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pfloat.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_pint.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-3.10/psycopg/adapter_qstring.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-3.10/psycopg/bytes_format.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-3.10/psycopg/connection_int.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-3.10/psycopg/connection_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-3.10/psycopg/cursor_int.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-3.10/psycopg/cursor_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/diagnostics_type.c -o build/temp.linux-x86_64-3.10/psycopg/diagnostics_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/error_type.c -o build/temp.linux-x86_64-3.10/psycopg/error_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/green.c -o build/temp.linux-x86_64-3.10/psycopg/green.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/libpq_support.c -o build/temp.linux-x86_64-3.10/psycopg/libpq_support.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/lobject_int.c -o build/temp.linux-x86_64-3.10/psycopg/lobject_int.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/lobject_type.c -o build/temp.linux-x86_64-3.10/psycopg/lobject_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/microprotocols.c -o build/temp.linux-x86_64-3.10/psycopg/microprotocols.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-3.10/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-3.10/psycopg/notify_type.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-3.10/psycopg/pqpath.o -Wdeclaration-after-statement
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=141000 -DHAVE_LO64=1 -I/usr/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.10/psycopg/psycopgmodule.o -Wdeclaration-after-statement
      psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
      psycopg/psycopgmodule.c:685:18: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        685 |     while (interp->next)
            |                  ^~
      psycopg/psycopgmodule.c:686:24: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
        686 |         interp = interp->next;
            |                        ^~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
ERROR: Could not build wheels for psycopg2, which is required to install pyproject.toml-based projects```

ubuntu@ip-172-31-29-115:~/pgserver$ 
garethbjohnson commented 10 months ago

Hello, I remember recently having an issue like that with an older version of Ubuntu. I then upgraded to Ubuntu 22 and used the latest Gutendex code, and it worked.

If that does not help you, and if you answer a few questions, I will try to reproduce the issue and investigate the cause: