【发布时间】:2023-03-11 04:35:01
【问题描述】:
我已经安装了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 不在我的路径中,尽管我将 C:\pgsql96\bin 添加到我的系统变量中(应该将它添加到用户变量而不是系统变量中吗?我也尝试将它添加到两个环境变量中!!)但命令:
which pg_config
返回我:
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 路径,结果如下:ANOTHER ERROR:
$ 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
有什么想法吗?
【问题讨论】:
标签: python git bash postgresql multicorn