问题:
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
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4355686