Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 'invalid syntax' for downloading spacy model

Tags:

python-3.x

I try to download spacy model on Jupyter notebook but it prints out 'invalid syntax'

python -m spacy download 'en_core_web_sm'

Is there any solution to help me download the model successfully?

like image 934
Kelvin chan Avatar asked Oct 22 '25 08:10

Kelvin chan


1 Answers

To help someone in the future. For me this problem was because I installed spacy not correctly, just by using pip install spacy.

Follow official instructions from the website, and it will download correctly.

In anaconda:

%pip install -U pip setuptools wheel
%pip install -U spacy

Once spacy is installed, run:

!python -m spacy download en_core_web_sm

This worked in my case, when I've had the same problem.

like image 137
Cassiopea Avatar answered Oct 25 '25 01:10

Cassiopea