llama_index [Bug]:错误:构建pystemmer轮子失败

i5desfxk  于 6个月前  发布在  其他
关注(0)|答案(1)|浏览(50)

Bug Description

I couldn't install llama-index-retrievers-bm25 on Python 3.11
.9 with Ubuntu 22.0
m/.venv/include -I/usr/include/python3.11 -c src/Stemmer.c -o build/temp.linux-x86_64-cpython-311/src/Stemmer.o src/Stemmer.c:6:10: fatal error: Python.h: No such file or directory 6 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pystemmer Running setup.py clean for pystemmer Failed to build pystemmer ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pystemmer)

Version

0.10.55

Steps to Reproduce

pip install llama-index-retrievers-bm25

Relevant Logs/Tracbacks

  • No response*
hsgswve4

hsgswve41#

要解决在尝试使用Ubuntu 22.04和Python 3.11.9安装llama-index-retrievers-bm25时缺少Python.h文件的问题,您需要安装Python开发头文件。您可以通过在终端中运行以下命令来实现这一点:

sudo apt-get install python3.11-dev

这将安装必要的开发文件,包括Python.h,这些文件对于构建Python扩展1(https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/retrievers/llama-index-retrievers-bm25/llama_index/retrievers/bm25/BUILD)是必需的。

  • 要继续与Dosu交流,请提及@dosu。*

相关问题