install pg_config in CentOS 5.5 without yum

python version 2.4

# pip install psycopg2

Getting the following error:

Downloading/unpacking psycopg2 Running setup.py egg_info for package psycopg2

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'.
Complete output from command python setup.py egg_info:
running egg_info

 writing pip-egg-info/psycopg2.egg-info/PKG-INFO
 writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
 writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
 warning: manifest_maker: standard file '-c' not found

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'.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /root/sources/build/psycopg2
Storing complete log in /root/.pip/pip.log
[root@host sources]# which pg_config
/usr/bin/which: no pg_config in     (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/b    in:/root/bin)

I am unable to install pg_config as an executable

Answers


You need to install postgresql-devel package.

Or build Postgres from source and then you'll have pg_config not from a package.


For AWS linux (or RedHat for that matter) use:

sudo yum install postgresql-devel

The above answer is correct: you need to install the -devel package. Furthermore, I found via this comment that you then might need to manually specify where to look for pg_config to build psycopg2.

In particular, I wound up running

python2.7 setup.py build_ext --pg-config /usr/pgsql-9.3/bin/pg_config install

Note that this path will depend on your postgres version.


Need Your Help

Android Connection reset by peer exception

android tcp arduino

I am writing an Android app to send data from android to arduino board over TCP. For testing purposes I just write the character 'A' from Android to Arduino. However, I noticed that after writing 2...

ListBox MouseBinding to Command not working

wpf listbox command commandbinding inputbinding

I want to bind the MouseDoubleClick (or PreviewMouseDoubleClick) to my custom Command defined in my custom WPF Control.