2023-03-09T18:09:27.5616906Z In file included from psycopg/adapter_asis.c:28: 2023-03-09T18:09:27.5617219Z ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory 2023-03-09T18:09:27.5617489Z 35 | #include 2023-03-09T18:09:27.5617699Z | ^~~~~~~~~~ 2023-03-09T18:09:27.5617915Z compilation terminated. 2023-03-09T18:09:27.5618020Z 2023-03-09T18:09:27.5618271Z It appears you are missing some prerequisite to build the package from source. 2023-03-09T18:09:27.5618410Z 2023-03-09T18:09:27.5618783Z You may install a binary package by installing 'psycopg2-binary' from PyPI. 2023-03-09T18:09:27.5619104Z If you want to install psycopg2 from source, please install the packages 2023-03-09T18:09:27.5619394Z required for the build and try again. 2023-03-09T18:09:27.5619496Z 2023-03-09T18:09:27.5619854Z For further information please check the 'doc/src/install.rst' file (also at 2023-03-09T18:09:27.5620157Z ). 2023-03-09T18:09:27.5620284Z 2023-03-09T18:09:27.5620595Z error: command '/usr/bin/gcc' failed with exit code 1 2023-03-09T18:09:27.5620928Z error: subprocess-exited-with-error 2023-03-09T18:09:27.5621138Z 2023-03-09T18:09:27.5621477Z × Running setup.py install for psycopg2 did not run successfully. 2023-03-09T18:09:27.5621784Z │ exit code: 1 2023-03-09T18:09:27.5622065Z ╰─> See above for output. 2023-03-09T18:09:27.5622260Z 2023-03-09T18:09:27.5622518Z note: This error originates from a subprocess, and is likely not a problem with pip. 2023-03-09T18:09:27.5622927Z full command: /usr/bin/../../opt/az/bin/python3 -u -c ' 2023-03-09T18:09:27.5623236Z exec(compile('"'"''"'"''"'"' 2023-03-09T18:09:27.5623614Z # This is -- a caller that pip uses to run setup.py 2023-03-09T18:09:27.5623852Z # 2023-03-09T18:09:27.5624224Z # - It imports setuptools before invoking setup.py, to enable projects that directly 2023-03-09T18:09:27.5624547Z # import from `distutils.core` to work with newer packaging standards. 2023-03-09T18:09:27.5624953Z # - It provides a clear error message when setuptools is not installed. 2023-03-09T18:09:27.5625378Z # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so 2023-03-09T18:09:27.5625829Z # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning: 2023-03-09T18:09:27.5626234Z # manifest_maker: standard file '"'"'-c'"'"' not found". 2023-03-09T18:09:27.5626623Z # - It generates a shim setup.py, for handling setup.cfg-only projects. 2023-03-09T18:09:27.5626887Z import os, sys, tokenize 2023-03-09T18:09:27.5627083Z 2023-03-09T18:09:27.5627257Z try: 2023-03-09T18:09:27.5627456Z import setuptools 2023-03-09T18:09:27.5627678Z except ImportError as error: 2023-03-09T18:09:27.5627884Z print( 2023-03-09T18:09:27.5628143Z "ERROR: Can not execute `setup.py` since setuptools is not available in " 2023-03-09T18:09:27.5628418Z "the build environment.", 2023-03-09T18:09:27.5628636Z file=sys.stderr, 2023-03-09T18:09:27.5628827Z ) 2023-03-09T18:09:27.5629012Z sys.exit(1) 2023-03-09T18:09:27.5629193Z 2023-03-09T18:09:27.5629375Z __file__ = %r 2023-03-09T18:09:27.5629580Z sys.argv[0] = __file__ 2023-03-09T18:09:27.5629972Z 2023-03-09T18:09:27.5630175Z if os.path.exists(__file__): 2023-03-09T18:09:27.5630395Z filename = __file__ 2023-03-09T18:09:27.5630639Z with tokenize.open(__file__) as f: 2023-03-09T18:09:27.5630872Z setup_py_code = f.read() 2023-03-09T18:09:27.5631073Z else: 2023-03-09T18:09:27.5631405Z filename = "" 2023-03-09T18:09:27.5632648Z setup_py_code = "from setuptools import setup; setup()" 2023-03-09T18:09:27.5632927Z 2023-03-09T18:09:27.5635094Z cwd: /tmp/pip-install-ur0d6h6m/psycopg2_599794d5f85e49edaf63d1aa8f7da481/ 2023-03-09T18:09:27.5635523Z Running setup.py install for psycopg2: finished with status 'error' 2023-03-09T18:09:27.5635850Z error: legacy-install-failure 2023-03-09T18:09:27.5635948Z 2023-03-09T18:09:27.5636259Z × Encountered error while trying to install package. 2023-03-09T18:09:27.5636567Z ╰─> psycopg2 2023-03-09T18:09:27.5636649Z 2023-03-09T18:09:27.5636891Z note: This is an issue with the package mentioned above, not pip. 2023-03-09T18:09:27.5637167Z hint: See above for output from the failure. 2023-03-09T18:09:27.5637411Z Exception information: 2023-03-09T18:09:27.5637645Z Traceback (most recent call last): 2023-03-09T18:09:27.5638097Z File "/opt/az/lib/python3.10/site-packages/pip/_internal/operations/install/legacy.py", line 97, in install 2023-03-09T18:09:27.5638391Z runner(