找不到pg_config可执行文件 [英] pg_config executable not found

查看:90
本文介绍了找不到pg_config可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装psycopg2时遇到问题.尝试pip install psycopg2时出现以下错误:

I am having trouble installing psycopg2. I get the following error when I try to pip install 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'.

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2

但是问题是pg_config实际上在我的PATH中;它运行没有任何问题:

But the problem is pg_config is actually in my PATH; it runs without any problem:

$ which pg_config
/usr/pgsql-9.1/bin/pg_config

我尝试将pg_config路径添加到setup.cfg文件,并使用我从其网站下载的源文件进行构建( http://initd.org/psycopg/),我收到以下错误消息!

I tried adding the pg_config path to the setup.cfg file and building it using the source files I downloaded from their website (http://initd.org/psycopg/) and I get the following error message!

Error: Unable to find 'pg_config' file in '/usr/pgsql-9.1/bin/'

但是实际上是那里!

我对这些错误感到困惑.有人可以帮忙吗?

I am baffled by these errors. Can anyone help please?

顺便说一句,我sudo所有命令.我也在使用RHEL 5.5.

By the way, I sudo all the commands. Also I am on RHEL 5.5.

推荐答案

pg_configpostgresql-devel中(在Debian/Ubuntu中是libpq-dev,在Centos/Cygwin/Babun中是libpq-devel.)

pg_config is in postgresql-devel (libpq-dev in Debian/Ubuntu, libpq-devel on Centos/Cygwin/Babun.)

这篇关于找不到pg_config可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆