run-llama/llama_index · error · ImportError
Spacy is not installed, please install it with `pip install
Error message
Spacy is not installed, please install it with `pip install spacy`.
What it means
Error "Spacy is not installed, please install it with `pip install spacy`." thrown in run-llama/llama_index.
Source
Thrown at llama-index-core/llama_index/core/node_parser/text/semantic_double_merging_splitter.py:54
raise ValueError(
f"{language} language is not supported yet! Available languages: {LANGUAGES}"
)
if spacy_model not in LANGUAGE_MODELS[language] and model_validation:
raise ValueError(
f"{spacy_model} model is not matching your language: {language}"
)
self.language = language
self.spacy_model = spacy_model
self.nlp = None
self.stopwords: List[str] = []
def load_model(self) -> None:
try:
import spacy
except ImportError:
raise ImportError(
"Spacy is not installed, please install it with `pip install spacy`."
)
self.nlp = spacy.load(self.spacy_model) # type: ignore
self.stopwords = set(globals_helper.stopwords) # type: ignore
class SemanticDoubleMergingSplitterNodeParser(NodeParser):
"""
Semantic double merging text splitter.
Splits a document into Nodes, with each node being a group of semantically related sentences.
Supports either Spacy (language-specific) or an embedding model (any language, e.g. Hugging Face).
Args:
language_config (LanguageConfig): language and Spacy model when using Spacy backend (ignored if embed_model is set)
embed_model (Optional[BaseEmbedding]): when set, use this for similarity instead of Spacy (multilingual)
initial_threshold (float): sets threshold for initializing new chunk
appending_threshold (float): sets threshold for appending new sentences to chunkView on GitHub (pinned to afd0fef371)
Solutions
- Install spacy: `pip install spacy`.
- Also download the required model, e.g. `python -m spacy download en_core_web_md`.
When it happens
Trigger: Thrown at llama-index-core/llama_index/core/node_parser/text/semantic_double_merging_splitter.py:54 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/94fa09e933bdb087.
Report an issue: GitHub.