I am trying to load a NLP model \'en\' from SpaCy in my PyCharm and I am using Python 2.7 .
My code to load the \'en\' model is
nlp = spacy.load(\'en\', disable=[
Spacy explains several ways to download a model : https://spacy.io/usage/models#download
python -m
# Download best-matching version of specific model for your spaCy installation
python -m spacy download en_core_web_sm
# Out-of-the-box: download best-matching default model and create shortcut link
python -m spacy download en
# Download exact model version (doesn't create shortcut link)
python -m spacy download en_core_web_sm-2.2.0 --direct
pip
# With external URL
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
# With local file
pip install /Users/you/en_core_web_sm-2.2.0.tar.gz
https://spacy.io/usage/models#download-manual
I tried to do it by installing an URL package Project Interpreter in a virtual environment (venv) :
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.5/en_core_web_sm-2.2.5.tar.gz
But Pycharm failed to install the tar directly.
Solution :
Finally I just add the github URL of the tar in the requirements.txt
, then PyCharm will install it for you.
Add this below in requirements.txt :
# spacy
spacy
# spacy model
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.5/en_core_web_sm-2.2.5.tar.gz
You can do it for all the models on the github release page : https://github.com/explosion/spacy-models/releases/