我在安装psycopg2时遇到问题。尝试执行以下操作时出现以下错误pip install psycopg2:Error: pg_config executable not found.Please add the directory containing pg_config to the PATHor 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。
3 回答

慕尼黑8549860
TA贡献1818条经验 获得超11个赞
pg_config
位于postgresql-devel
(libpq-dev
在libpq-devel
Cygwin / Babun上的Debian / Ubuntu中。)

倚天杖
TA贡献1828条经验 获得超3个赞
你安装好了python-dev吗?如果已经拥有,请尝试安装libpq-dev
sudo apt-get install libpq-dev python-dev
添加回答
举报
0/150
提交
取消