Last Updated on 2021-07-05 by Clay
Today when I use Python to process a NLP task, I get a error message:
OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
I got this in the past, the problem is I use a Python package "spacy" to work, but the spacy module didn't find model "en" to process the English input. Every time when I transfer to a new environment, I got this error message again.
The good news is that the problem is not difficult to solve. So I note a solution about how to solve it.
If I get this error in the future, I hope I can read this note to solve it with less time.
Spacy
spacy a NLP toolkit in Python, the performance is very powerful. It is very popular in English nature language processing.
Solution
If we loss any model, just like "en", we just need to download it. In fact, download Python packages is too easy so I unaccustomed to more operations ...... After all, most of time we just need to use "pip".
sudo pip3 install -U spacy
Then I didn't notice the need to install other things. After a test run, this problem is usually encountered:
OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
So we need a more operation.
python3 -m spacy download en
It is worth noting that sometimes even if it is installed, but still encounter the same error when using spacy. This may be because you did not have administrator rights when installing "en", which caused problems with the link.
You can use the admin to do it again.
sudo python3 -m spacy download en
Hope everyone is going well.
Thanks
Glad to help you =)
Hi
Thanks a lot, this solved my problem
Hi
Thanks a lot, this solved my problem, i was struggling with this issue
it does not work now. 2021-1-21
Thanks for your inform.
Thanks for your help. It worked for me 23/2/21
Thank you!
You’re welcome!