找不到 pg_config 可执行文件

新手上路,请多包涵

我在安装 psycopg2 时遇到问题。当我尝试 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 ;它运行没有任何问题:

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

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

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

但它实际上是存在的!!!

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

顺便说一句,我 sudo 所有的命令。我也在 RHEL 5.5 上。

原文由 user1448207 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.6k
1 个回答

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

原文由 TilmanBaumann 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题