7

So here is my goal: To get a .py file that imports pgdb, to run.

For this, as far as I have understood, I need PygreSql.

I have both postgresql 9.4.4 and python 2.7.9 installed (Postgresql with source code and python with the normal download form the website.). I found the file PyGreSQL.tar (version 4.1.1) and I ran the command python setup.py build in the directory of the extracted tar file. I get the message Exception: pg_config tool is not available.. What can I do to fix this?

Thanks in advance!

Sahand
  • 7,980
  • 23
  • 69
  • 137
  • The PostgreSQL `bin` directory containing `pg_config` must be on the `PATH`. You installed from source so you shouldn't need to worry about -dev or -devel packages; users who install from packages need to also install the appropriate `devel` package for the PostgreSQL server packages they're using. Is `pg_config` on your `PATH`? If you run `pg_config` what's the output? – Craig Ringer Sep 23 '15 at 23:55

2 Answers2

11

Try running this:

sudo apt-get install libpq-dev

and retry.

Ivan_ug
  • 2,467
  • 2
  • 17
  • 18
0

Run the command:

sudo apt-get install postgresql-server-dev-X.X

in your case X.X is 9.4

Unheilig
  • 16,196
  • 193
  • 68
  • 98