23
votes

When running:

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

the following is printed:

Warning: no model found for 'en' Only loading the 'en' tokenizer.

/site-packages/spacy/data is empty with the exception of the init file. all filepaths are only pointing to my single installation of python.

Any help appreciated on resolving this.

Thanks! Will

11
Hi Will, if any of the answers here solved your problem, kindly accept it as the answer :) - zelusp

11 Answers

35
votes

I had this same issue when I tried this on Windows 10 - the problem was the output of python -m spacy.en.download all said Linking successful but above that was the message that the symbolic link wasn't actually created, due to permissions.

Running python -m spacy.en.download all as an Adminstrator fixed the problem.

7
votes

You might need to install the specific module too after installing spacy. Try:

python -m spacy.en.download all

Here is the reference link: https://pypi.python.org/pypi/spacy

6
votes

If you’ve installed a model via pip, you can also import it directly and then call its load() method:

python -m spacy download en

import spacy
import en_core_web_sm

nlp = en_core_web_.load()
doc = nlp(u'This is a sentence.')
5
votes

run cmd as an administrator ,then download the model en package

python -m spacy download en
3
votes

In my case I had a previous installation of spacy that had created the symlink.

ls -al "/usr/local/lib/python3.5/dist-packages/spacy/data/en"
lrwxrwxrwx 1 root staff 74 Dec  5 00:40 /usr/local/lib/python3.5/dist-packages/spacy/data/en -> /usr/local/lib/python3.5/dist-packages/en_core_web_sm/en_core_web_sm-1.2.0

rm "/usr/local/lib/python3.5/dist-packages/spacy/data/en"

python3 -m spacy download en

And then everything is good.

3
votes

This works for Ubuntu users.

sudo python -m spacy download en
2
votes

When you use spaCy's download command, it will create shortcut links automatically.

python -m spacy download en

But if you already have downloaded the model, you don't need to download it again, you can create a link using the link command.

python -m spacy download en_core_web_sm
python -m spacy link en_core_web_sm en
1
votes

I got around this by simply importing the model instead of performing nlp = spacy.load('en')

0
votes

If python -m spacy download en does not work for you (permissions, etc.), you can download the model first and then pip install it. For example, this is for version 2.3:

https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz

The .tar.gz archive is the same file that's downloaded during spacy download, and is installable:

pip install /path/to/en_core_web_sm-2.0.0.tar.gz

Then you can do:

import en_core_web_sm

nlp = en_core_web_sm.load()
-1
votes

In windows user name can be added in "Create symbolic link" in "Local security policy" before downloading en. It is working for me.

-2
votes

First you need to train the model. After training, You need to go through a saving and loading process. After that, I hope It'll work. Good Luck. Since they updated the spacy version, find it Here