找不到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。


扬帆大鱼
浏览 1840回答 3
3回答

慕尼黑8549860

pg_config位于postgresql-devel(libpq-dev在libpq-develCygwin / Babun上的Debian / Ubuntu中。)

倚天杖

你安装好了python-dev吗?如果已经拥有,请尝试安装libpq-devsudo apt-get install libpq-dev python-dev
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python