找不到pg_config可执行文件

你离开我真会死。 提交于 2020-08-13 11:51:01

问题:

I am having trouble installing psycopg2. 我在安装psycopg2时遇到问题。 I get the following error when I try to pip install 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

But the problem is pg_config is actually in my PATH ; 但是问题是pg_config实际上在我的PATH it runs without any problem: 它运行没有任何问题:

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

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! 我尝试将pg_config路径添加到setup.cfg文件,并使用从其网站( http://initd.org/psycopg/ )下载的源文件进行构建,然后得到以下错误消息!

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

But it is actually THERE!!! 但是实际上是那里!!!

I am baffled by these errors. 这些错误使我感到困惑。 Can anyone help please? 有人可以帮忙吗?

By the way, I sudo all the commands. 顺便说一句,我sudo所有命令。 Also I am on RHEL 5.5. 我也在使用RHEL 5.5。


解决方案:

参考一: https://stackoom.com/question/mkba/找不到pg-config可执行文件
参考二: https://oldbug.net/q/mkba/pg-config-executable-not-found
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!