Python hunspell package installation via pip fails

2024-04-29 19:39:04 发布

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

安装hunspell python包(通过pip)失败,并出现以下错误:

hunspell.c:21:22: fatal error: hunspell.h: No such file or directory
 #include <hunspell.h>
                      ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

你知道怎么解决这个问题吗?在


Tags: pipornoinclude错误errordirectoryx86
3条回答

尝试:

sudo apt-get install libhunspell-dev
pip install hunspell

…正如pyhunspell的github页面(由johnd提供)中同一个线程中的建议:https://github.com/blatinier/pyhunspell/issues/22

我不能安装'hunspell dev',但我可以安装libhunspell-dev

试试看 sudo apt-get install hunspell-dev 然后再次尝试安装hunspell(或pyhunspell)

pyhuspell的github页面上的一个问题引用了这个问题: https://github.com/blatinier/pyhunspell/issues/22

这对我有用

sudo apt-get install libhunspell-dev
python3 -m pip install hunspell

或者用这个

{a1}

相关问题 更多 >