google buildpack psycopg2-binary Error: pg_config executable not found
No, you are not wrong; I had the same issue today, and after a bit of googling I found this (solved) github issue: https://github.com/psycopg/psycopg2/issues/699#
The comments there (https://github.com/psycopg/psycopg2/issues/699#issuecomment-377188700) indicate one possible cause for the issue is using an outdated version of pip.
I was using version 18.x, and after upgrading it (
python -m pip install -U pip, which got me pip 21.1.3), the installation of psycopg2-binary finished successfully (as expected) even though I don't have any postgres dev libraries installed.
Cannot find pg_config executable
Install PostgreSQL. When installing from packages, make sure to install the development package that contains
pg_config, PGXS and the C headers.
You may need to put the PostgreSQL binary directory on the
(Of course you have to use the correct path.)
Error: pg_config executable not found. even though I have added the path to pg_config on environment variable
The problem was that the environment variable
PATH was not set properly. It is used to find executables that are not in the current directory.
For your purposes you don't have to change the
Open the command line (DOS box) with
Look at the current settings with
Change the value for the current session with
SET PATH="C:\Program Files\PostgreSQL\12\bin";...
...is the current setting.
Now it should work.