run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
35.44k stars 5k forks source link

[Bug]: ERROR: Failed building wheel for pystemmer #14782

Open saidineshpola opened 2 months ago

saidineshpola commented 2 months ago

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

dosubot[bot] commented 2 months ago

To resolve the issue of the missing Python.h file when trying to install llama-index-retrievers-bm25 on Python 3.11.9 with Ubuntu 22.04, you need to install the Python development headers. You can do this by running the following command in your terminal:

sudo apt-get install python3.11-dev

This will install the necessary development files, including Python.h, which are required for building Python extensions [1].

To continue talking to Dosu, mention @dosu.

Erland0rr commented 1 week ago

I solved similar problem by apt-get install -y build-essential when installing fastembed. You can try it.