0

For Project 1: When running "pip3 install -r requirements.txt" for the initial setup, I get an issue with the psycopg2 dependency:

Error: pg_config executable not found.

 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'.

0

Ok, so Postgres on macos does not add it's self to PATH so that's why it was not found.

A simple thing is to add that path to your bash profile. In my case I was using Postgres 11 so the steps where:

  • Open bash profile e.g. : atom ~/.bash_profile (note you can use any text editor - I use atom)
  • Add Postgres PATH & save: add the following line export PATH="/Library/PostgreSQL/11/bin:$PATH" (that path & version no. maybe different for you).
  • Apply change: Run the command source ~/.bash_profile

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .