I'm working on a codebase that uses Spacy. I installed spacy using:
sudo pip3 install spacy
and then
sudo python3 -m spacy download en
At the end of this last command, I got a message:
Linking successful
/home/rayabhik/.local/lib/python3.5/site-packages/en_core_web_sm -->
/home/rayabhik/.local/lib/python3.5/site-packages/spacy/data/en
You can now load the model via spacy.load('en')
Now, when I try running my code, on the line:
from spacy.en import English
it gives me the following error:
ImportError: No module named 'spacy.en'
I've looked on Stackexchange and the closest is: Import error with spacy: "No module named en"
which does not solve my problem.
Any help would be appreciated. Thanks.
Edit: I might have solved this by doing the following:
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
>>> spacy.load('en')
<spacy.lang.en.English object at 0x7ff414e1e0b8>
and then using:
from spacy.lang.en import English
I'm still keeping this open in case there are any other answers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…