1

I'm relatively new to Python, extremely new to Django and Heroku, and also rather new to working in the terminal.

I'm attempting to follow the instructions on setting up a Django Heroku project found here. I'm getting stuck at the following command:

pip install django-toolbelt

I keep getting the following error:

Error: pg_config executable not found.

I don't know if any of this is even remotely related to the problem, but these are the things I've tried so far:

  • Tried reinstalling the django-toolbelt (just running the command again)
  • Tried switching from Postgres.app to the full Mac OSX install

No luck. What am I missing?

EDIT: Per Midimo's suggestion, I tried installing python-dev. This is what happened:

(venv)Macbook:[SITE] [USER]$ pip install python-dev
Downloading/unpacking python-dev
  Could not find any downloads that satisfy the requirement python-dev
Cleaning up...
No distributions at all found for python-dev
Storing complete log in /Users/[USER]/.pip/pip.log

EDIT 2: And this is what happened when I tried to install libpq-dev...

(venv)Macbook:[SITE] [USER]$ pip install libpq-dev
Downloading/unpacking libpq-dev
  Could not find any downloads that satisfy the requirement libpq-dev
Cleaning up...
No distributions at all found for libpq-dev
Storing complete log in /Users/[USER]/.pip/pip.log

5 Answers 5

3

do you have python-dev installed? If you did, try installing libpq-dev

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the suggestion, Midimo! I tried installing python-dev, but it doesn't want to install, either. See the OP for more details. Any other ideas?
2

Before installing django-toolbelt you have to install those following dependencies:

$ sudo apt-get install python-dev python-psycopg2 libpq-dev

And then in the virtualenv:

(myven)trinh@trinh-pc:/path/to/django/project$ pip install django-toolbelt

Source :

2 Comments

Thanks for the help, Midimo! My goodness, installing apt-get on Mavericks looks to be a nightmare. Is there a way to install libpq-dev using pip? /goes looking/
for some reason i though you were using linus/ubuntu download and install PostGre from this page (using .dmg file could be your better choice) postgresql.org/download/macosx
1

I had same problem: one of the messages was couldn't run pg_config. Despite fact I had pg_config on my PATH and had restarted terminal to be sure.

My solution was to just run pg_config right before pip install django-toolbelt.

install than ran without any errors.

Comments

1

Just in case this will help anyone.

I'm working through this on Windows and was having this problem while trying to install django-toolbelt via pip in a virtualenv.

I had to add the entire directory to my PATH and make sure that Program Files was in quotes --

PATH=$PATH:/c/"program files"/postgresql/9.4/bin/

I was trying to get this work for hours so hopefully this helps someone else!

Comments

0

You need Postgres on you Mac because the django-toolbelt will try to install psycopg2 that won't find the path for the database and will raise the error.

The easiest solution is to install the Postgres.app and then add to the .profile file located on your home folder the following and restart or just run the command manually in the terminal:

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

Now you are ready to install the toolbelt

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.