2012-03-07 11 views
6

versión 2.4 pitóninstalación pg_config en CentOS 5.5 y sin yum

# PIP instalar psycopg2

consiguiendo el error siguiente:

Descargar/psycopg2 desembalaje Correr egg_info setup.py para psycopg2 paquete

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 
[[email protected] 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) 

No puedo instalar pg_config como un ejecutable

Respuesta

14

Necesita instalar el paquete postgresql-devel.

O construye Postgres desde la fuente y luego tendrás pg_config no de un paquete.

1

La respuesta anterior es correcta: debe instalar el paquete -devel. Además, encontré a través de this comment que luego podría necesitar especificar manualmente dónde buscar pg_config para compilar psycopg2.

En particular, terminé corriendo

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

Tenga en cuenta que este camino dependerá de la versión de postgres.

2

Para AWS Linux (RedHat o para el caso) usar:

sudo yum install postgresql-devel 
Cuestiones relacionadas