spaCy: OSError [E050] Can't find model 'en_core_web_sm'
Traceback (most recent call last):
File "app.py", line 3, in <module>
nlp = spacy.load("en_core_web_sm")
OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.
Immediate Remediation
bash
python -m spacy download en_core_web_sm
Root Cause Analysis
The spaCy model package is not installed in the current environment. spaCy requires the model to be downloaded separately before it can be loaded via spacy.load().
Verification & Guardrails
- Ensure you are using the same Python environment where spaCy is installed.
- For production, consider packaging the model as a dependency or using a requirements.txt with the model URL.
- Verify with `python -c "import spacy; nlp=spacy.load('en_core_web_sm')"` after download.
Have a custom or uncategorized crash?
Run your trace through our in-memory client privacy sandbox for instant SRE remediation.