找不到pg_config可执行文件 [英] pg_config executable not found
问题描述
我在安装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_config
在postgresql-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屋!