gpt4 book ai didi

python - 我正在尝试使用 brew 安装 postgresql,但找不到 Python.h

转载 作者:行者123 更新时间:2023-11-29 14:00:49 25 4
gpt4 key购买 nike

我尝试用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,它说:

brew install python
Warning: python-2.7.5 already installed, it's just not linked

我需要做什么?谢谢

最佳答案

你必须告诉 Homebrew 链接 Python:

$ brew link python

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

出现这种情况的原因是Python似乎只作为依赖安装,但是请求的包(PostgreSQL)安装失败,所以它的依赖仍然安装但没有链接(即激活)。

关于python - 我正在尝试使用 brew 安装 postgresql,但找不到 Python.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19141657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com