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。
sudo
命令运行命令时,$PATH会发生变化。请确认您作为root用户的$PATH是否正确。 - Hugo Lopes Tavaresln -s /usr/pgsql-9.1/bin/pg_config /usr/sbin/pg_config
,一切正常! - CK.Nguyen