Andrew Jennings
Andrew Jennings

Reputation: 21

Loading the spacy german language model into a jupyter notebook

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.

Upvotes: 2

Views: 4181

Answers (2)

Rihab Al-yasiri
Rihab Al-yasiri

Reputation: 11

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

Upvotes: 0

Ajay John Alex
Ajay John Alex

Reputation: 993

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

Upvotes: 2

Related Questions