-2

I am trying to install the psycopg2 package on my mac in the virtual environment so I can use Heroku to deploy my project. I am getting this Error: pg_config executable not found. I have tried pip install psycog2-binary but when I go to install django-heroku it still brings up the same error. Does know how I can fix this to install the psycopg2 package?

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).

----------------------------------------
AMC
  • 2,466
  • 7
  • 11
  • 31
  • What it says when you do `pip install psycopg2-binary` ? – shivank98 Apr 26 '20 at 00:52
  • Does this answer your question? [pg\_config executable not found](https://stackoverflow.com/questions/11618898/pg-config-executable-not-found) – AMC Apr 26 '20 at 02:56

1 Answers1

0

"please install the PyPI 'psycopg2-binary'"

You can do this by running the following

pip install psycopg2-binary
  • It is worth noting that when you run this as pip install in your virtual environment, your import statement can stay the same in your python script. no need to change it to psycopg2-binary – dilloncwheeler Apr 26 '20 at 01:17