Bug Description
I couldn't install llama-index-retrievers-bm25 on Python 3.11
.9 with Ubuntu 22.0m/.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*
1条答案
按热度按时间hsgswve41#
要解决在尝试使用Ubuntu 22.04和Python 3.11.9安装
llama-index-retrievers-bm25
时缺少Python.h
文件的问题,您需要安装Python开发头文件。您可以通过在终端中运行以下命令来实现这一点:这将安装必要的开发文件,包括
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)是必需的。