Ignatius Ezeani
Ignatius Ezeani

Reputation: 53

Streamlit Cloud OSError: [E053] Could not read config file

I am deploying an app that specifically requires spaCy==3.3.1 to Streamlit cloud, which I added to the requirement.txt as well as the link to download and install en_core_web_sm which is

https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz#egg=en_core_web_sm.

The import is okay but when I load the model i.e. nlp = spacy.load("en_core_web_sm"), I will get the OSError below:

OSError: [E053] Could not read config file from /home/appuser/venv/lib/python3.9/site-packages/en_core_web_sm/en_core_web_sm-2.2.0/config.cfg

What am I doing wrong?

Thanks in advance for your help.


My requirements.txt:

spacy==3.3.1

https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz#egg=en_core_web_sm

Main code:

import en_core_web_sm
nlp = spacy.load("en_core_web_sm")

I expected no error but got the OSError: [E053] above.

Upvotes: 2

Views: 284

Answers (1)

J. Ferrarons
J. Ferrarons

Reputation: 630

Packages trained with spaCy v2.x are not compatible with spaCy v3.x (source)

Note that the model has version 2.2.0 but spacy has version 3.3.1.

I'd suggest to use a newer version of the model. The requirements could look like:

spacy==3.3.1
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0-py3-none-any.whl

Upvotes: 2

Related Questions