Error: 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 #10895
Replies: 2 comments 20 replies
-
This might be a virtual environment thing. There could be a difference between:
and
I couldn't help but notice some of your commands omit Could you try running: # Use python explicitly to grab info.
python -m spacy info
# Just confirm the versions via pip too
python -m pip freeze | grep spacy
# Download the en_core_web_sm model explicitly
python -m spacy download en_core_web_sm Once that's downloaded, you should be able to load in the model via: import spacy
nlp = spacy.load("en_core_web_sm") |
Beta Was this translation helpful? Give feedback.
-
Hello everyone. I worked with nlp = spacy.load("en_core_web_sm") having generated .exe with PyInstaller, considering that in the python interpreter environment the software worked well. When executing the .exe the following error occurred: Error: 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. I was able to solve it by watching the video published in: https://ar.video.search.yahoo.com/search/video;_ylt=AwrJ_GuHE1lmbjIAzFmr9Qt.;_ylu=Y29sbwNiZjEEcG9zAzEEdnRpZAMEc2VjA3BpdnM-?p=OSError%3A+%5BE050%5D+Can%27t+find+model+%27en_core_web_s m%27. +It+doesn%27t+seem+to+be+a+Python+package+or+a+valid+path+to+a+data+directory.&fr2=piv-web&type=E210AR739G0&fr=mcafee#id=2&vid=33eb7c89f0a4a4d380f2fb6865a978cc&action =view It was necessary to replace the statement nlp = spacy.load("en_core_web_sm") in my source program with nlp = spacy.load("C:\Users\claud\OneDrive\Desktop\Python312.venv\Lib\site-packages\en_core_web_sm \en_core_web_sm-3.7.1") That is, as the video explains, I directly replaced "en_core_web_sm" with the address on my Windows 11 notebook where the spacy library (python -m spacy download en). Thank you so much |
Beta Was this translation helpful? Give feedback.
-
I'm trying to load the
en_core_web_sm
spaCy model, but I have been unsuccessful in doing so.The error that occurs is the following:
I'm working in a Anaconda virtual environment. The following checkboxes are ticked:
conda activate gcp-env
prior to installing spaCy and the english language modelconda install -c conda-forge spacy
while on the right environmentpython -m spacy download en
, still while on the right environmentspacy
to therequirements.txt
, and installing dependencies via that route, after first attempts failedspacy info
produces this output:python -m spacy validate
produces this output:For additional context,
pip list
on the environment contains bothand
Even so,
import en_core_web_sm
also doesn't work:I've been through several previous StackOverflow posts on the same topic. Those have often been solved, but my issue remains. So I've also posted this same question to StackOverflow, but have not been able to find an answer (so far...).
Any advice would be very much appreciated. Thanks in advance!
Simon
Beta Was this translation helpful? Give feedback.
All reactions