Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error message installing Django-toolbelt on MacOSX

I'm attempting to follow the tutorial on Heroku to deploy a Django app. I'm doing this from within a virtualenv environment, as per the tutorial (https://devcenter.heroku.com/articles/getting-started-with-django), and have gotten to the point where I input:

pip install django-toolbelt

When I attempt to install django-toolbelt, I get the following error message:

Error: pg_config executable not found.

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

I have tried downloading PostgreSQL from the source and compiling it myself, I've tried downloading psycopg2 separately from the django-toolbelt and then going into the psycopg2 folder and adding the specific pathfile for pg_config. I found an old thread (Error when attempting to install django-toolkit within a python virtualenv) that seems to have described the identical problem, and I've tried the solutions offered on that post, and got the same error messages. It wasn't clear to me that the original poster of that question had found a solution to the problem, but I'm hoping someone has an idea.

Does this sound at all familiar to anyone? I am pretty new to this, and just don't have any good ideas for what else to try at this point. Thanks for reading and for any help you can offer!

like image 730
rafiki Avatar asked Apr 02 '26 21:04

rafiki


1 Answers

This fixed it for me: http://schalk-neethling.co.za/2015/01/resolving-error-pg_config-executable-not-found-on-mac/

  • brew install postgresql
  • export PATH=/usr/local/Cellar/postgresql/9.4.0/bin:$PATH note: check your version number
  • pip install psycopg2
like image 85
mkatt Avatar answered Apr 04 '26 10:04

mkatt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!