pg_config 安装时未找到

pg_config not found while I have it installed

我已经安装了postgresql开发包,在C:/pgsql96中(bin目录下有包,比如pg_config,我也把路径添加到我的环境变量中,现在我想要为了安装 Multicorn(一个 postgresql python 包),我在 C:/Multicorn 中克隆了 Multicorn 的 git 存储库,当我想 运行 make && make install 命令时,我得到了以下错误:

make: pg_config: Command not found
make: pythonpython:-config: Command not found
expr: syntax error
expr: syntax error
Python version is python:
./preflight-check.sh
which: no pg_config in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
No pg_config found in your path.
Please check if you installed the PostgreSQL development packages.
make: *** [Makefile:28: preflight-check] Error 1

我的系统中安装了 python,因为我可以从我的命令提示符访问它(我 运行 python --version 并且我看到我已经安装了它)但是在我正在 运行ning make && make install 的 MinGW bash 中,没有安装 python。 任何人都知道我该如何解决这些问题:

1) pg_config 不在我的路径中,尽管我将 C:\pgsql96\bin 添加到我的系统变量中(它应该添加到用户变量而不是系统变量中吗?我也尝试添加它到两个环境变量!!)但是命令:

which pg_config

returns我:

 no pg_config in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

2- 我可以从我的命令提示符访问 python 模块,但我无法从 mingw bash 访问它们,我需要使用 mingw bash 才能运行 make && make install 命令。你能解释一下什么时候应该使用命令提示符,什么时候应该使用 MinGW,以及这两者之间是否应该同步?

更新 1: 对于第一个找不到pg_config的问题,我把路径加到我的mingw/bin目录下。但是,我还有一个关于 python.h:

的问题
make: pythonpython:-config: Command not found
Python version is python:
x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2    -I. -I./ -IC:/pgsql96/include/server -IC:/pgsql96/include/internal -I/c/Builds/postgresql/source/src/include/port/win32 -DEXEC_BACKEND  -IC:/pgsql96/include/server/port/win32  -c -o src/errors.o src/errors.c
In file included from src/errors.c:15:0:
src/multicorn.h:1:20: fatal error: Python.h: No such file or directory
 #include "Python.h"
                    ^
compilation terminated.
make: *** [<builtin>: src/errors.o] Error 1

更新 2:

我在配置过程中添加了 Python 路径,结果如下:另一个错误:

$ make && make install
Python version is 2.7
[ -d sql ] || mkdir sql
[ -d src ] || mkdir src
touch directories.stamp
x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2  -I/usr/include/python2.7 -I/usr/include/python2.7  -I. -I./ -IC:/pgsql96/include/server -IC:/pgsql96/include/internal -I/c/Builds/postgresql/source/src/include/port/win32 -DEXEC_BACKEND  -IC:/pgsql96/include/server/port/win32  -c -o src/errors.o src/errors.c
make: *** [<builtin>: src/errors.o] Error 1

有什么想法吗?

尝试

PATH="/c/pgsql96/bin:$PATH" make