我试图使用brew安装postgresql,但找不到Python.h

2024-09-21 03:28:06 发布

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

我尝试使用brew安装postgresql,结果是

checking for libperl... yes
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: header file <Python.h> is required for Python

在这个错误之后,我安装了Python,它说:

^{pr2}$

我需要做什么? 谢谢


Tags: noforispostgresqlconfigurerequirederroryes
1条回答
网友
1楼 · 发布于 2024-09-21 03:28:06

您必须告诉Homebrew链接Python:

$ brew link python

在此之前,它只是安装在/usr/local/Cellar下的某个地方,但没有链接到/usr/local/bin(例如/usr/local/bin/python)和朋友。在

出现这种情况的原因是Python似乎只是作为一个依赖项安装的,但是请求的包(PostgreSQL)的安装失败了,因此它的依赖项被保留了,但没有链接(即激活)。在

相关问题 更多 >

    热门问题