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 PATH
:
export PATH=/usr/pgsql-14/bin:$PATH
(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 PATH
permanently:
Open the command line (DOS box) with
cmd.exe
.Look at the current settings with
PATH
.Change the value for the current session with
SET PATH="C:\Program Files\PostgreSQL\12\bin";...
where
...
is the current setting.
Now it should work.
Related Topics
How to Send Http Requests to Flask Server
How to Install Pip on Arch Linux
Detect and Exclude Outliers in a Pandas Dataframe
Determine Whether Integer Is Between Two Other Integers
Class Method Differences in Python: Bound, Unbound and Static
Run Certain Code Every N Seconds
Imploding a List for Use in a Python MySQLdb in Clause
How Are Tuples Unpacked in for Loops
How to Use 'Return' to Get Back Multiple Values from a for Loop? How to Put Them in a List
Iterate Through Pairs of Items in a Python List
How to Check for Palindrome Using Python Logic
Typeerror: 'Int' Object Is Not Callable
Should Wildcard Import Be Avoided
Scope of Python Variable in for Loop