安装时找不到pg_config

2024-10-01 09:33:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了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,我看到已经安装了它),但是在运行make&make install的MinGW bash中,没有安装python。 任何人都知道我如何解决这些问题:

1)pg_config in not in my path,尽管我在系统变量中添加了C:\pgsql96\bin(是否应该将其添加到用户变量而不是系统变量?我还尝试将它添加到两个环境变量中!!)但是命令:

^{pr2}$

返回给我:

 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 path,结果是:另一个错误:

$ 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

有什么想法吗?在


Tags: insrcconfigmakebinincludepostgresqlwindows