Natalia Resende
Natalia Resende

Reputation: 195

Error message when running a model from spacy package

I installed spacy package using 'pip install spacy' and the I installed a model using $ python -m spacy download pt_core_news_sm. The installation was successful. The message I got after the installation was:

Requirement already satisfied: pt_core_news_sm==2.1.0 from https://github.com/explosion/spacy-models/releases/download/pt_core_news_sm-2.1.0/pt_core_news_sm-2.1.0.tar.gz#egg=pt_core_news_sm==2.1.0 in /anaconda3/lib/python3.6/site-packages (2.1.0) ✔ Download and installation successful You can now load the model via spacy.load('pt_core_news_sm')

However, when I run spacy.load("pt_core_news_sm") using python idle, I get a error message:

Traceback (most recent call last): File "", line 1, in spacy.load("pt_core_news_sm") File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spacy/init.py", line 27, in load return util.load_model(name, **overrides) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spacy/util.py", line 136, in load_model raise IOError(Errors.E050.format(name=name)) OSError: [E050] Can't find model 'pt_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Why am I getting this message if the installation was successful?

Can anyone help me to figure out what is going on? I want to run POS tagger to my texts in Portuguese

Upvotes: 0

Views: 647

Answers (2)

Kumar Divyanshu
Kumar Divyanshu

Reputation: 43

Try to run spaCy by setting an environment. In you'r case maybe your model is not installed correctly, reninstall the model pt_core_news_sm

Upvotes: 0

Alexis Pister
Alexis Pister

Reputation: 499

It may not be the same python installation in your command line and inside the python idle.

You can compare the ouptut of the sys.path command, which tells you the PYTHONPATH used.

Upvotes: 0

Related Questions