0

This is the cell in notebook:

#%%

!python -m spacy download de_core_news_sm
spacy_en = spacy.load('en_core_web_sm')
spacy_de = spacy.load('de_core_news_sm')

I get this error:

OSError: [E050] Can't find model 'de_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

I'm puzzled as I think I've followed the spacy instructions correctly.

J. Murray
  • 1,460
  • 11
  • 19
  • I also get "no module spacy" when doing the python -m spacy . How do I download a spacy model in a jupyter script ? – Andrew Jennings Oct 13 '19 at 11:10
  • I tried running this on google colab and it indicated: Successfully installed de-core-news-sm-2.1.0 ✔ Download and installation successful You can now load the model via spacy.load('de_core_news_sm') : but it fails the same way. – Andrew Jennings Oct 13 '19 at 11:17

2 Answers2

1

Once you execute

!python -m spacy download de_core_news_sm
spacy_de = spacy.load('de_core_news_sm')
spacy_en = spacy.load('en_core_web_sm')

Simply restart your runtime . From Runtime > Restart runtime .And run

import spacy
nlp = spacy.load('de_core_news_sm') 

Works for me .Hope it was helpful

Ajay Alex
  • 473
  • 4
  • 7
0

if you use anaconda jupyter notebook then just run this code and problem will solve:conda install -c conda-forge spacy-model-de_core_news_sm