Mac + virtualenv + pip + postgresql = Error: pg_config executable not found

On the Mac, if you’re using, the pg_config file is in your /Applications/<current_version>/bin directory. That’ll need to be added to your system path to fix this error, like this:

export PATH=$PATH:/Applications/<current_version>/bin

So for example, if the current version is 9.5, this export line would be:

export PATH=$PATH:/Applications/

With more recent versions of the (> 9.5?), you can simply add “latest” in place of the version number, like so:

export PATH=$PATH:/Applications/

Leave a Comment