even though I downloaded the model it cannot load it
[jalal@goku entity-sentiment-analysis]$ which python
/scratch/sjn/anaconda/bin/python
[jalal@goku entity
oh well. turns out even though my which python was showing anaconda python, when I was using python download it was linking it to python2.7 local on my machine. I fixed it using below command:
$ sudo /scratch/sjn/anaconda/bin/python -m spacy download en
Since you are using python version 3.6, try using -
python3 -m spacy download en
instead of just python -m .....
If you have already downloaded spacy and the language model (E.g., en_core_web_sm or en_core_web_md), then you can follow these steps:
Open Anaconda prompt as admin
Then type : python -m spacy link [package name or path] [shortcut]
For E.g., python -m spacy link /Users/you/model en
This will create a symlink to the your language model. Now you can load the model using spacy.load("en") in your notebooks or scripts
Go to https://github.com/explosion/spacy-models
Download the model you want to load in SpaCy
Paste the downloaded file in SpaCy folder present inside the Anaconda folder
open cmd there. Type the following command and hit enter:
pip install en_core_web_md-1.2.0.tar.gz
The above command may vary depending upon the version of the file downloaded.
Voila! Error has gone :)
FINALLY CLEARED THE ERROR !!!
Always Open Anaconda Prompt / Command Prompt with Admin Rights to avoid Linking errors!!!
Tried multiple options including :
python -m spacy download en
conda install -c conda-forge spacy
python -m spacy download en_core_web_sm
python -m spacy link en_core_web_sm en
None worked since im using my Company's Network. Finally this Command Worked like a Charm :-)
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz --no-deps
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz --no-deps
Thanks to the Updated Github Links :-)
By using sudo python ...
you install the model for a different python interpreter than your local one. In fact, it says in your log that the spaCy model is installed to /usr/lib64/python2.7/site-packages/
instead of /scratch/sjn/anaconda/lib/python3.6/site-packages/
.
Try running python -m spacy download en
and it should install the model to the correct directory.