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

查看:39
本文介绍了找不到 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_config is in postgresql-devel (libpq-dev in Debian/Ubuntu,libpq-devel 在 Centos/Fedora/Cygwin/Babun 上.)

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

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

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