No module named 'en_core_web_sm'

I am deploying an app using streamlit share and getting this error. The code is working fine on my local but getting error on deployment. The requirement file is update and has an entry as


This is the piece of code where I can getting error.

Is there any workaround to get rid of this issue?


Hello @tech,

I’ve tried pip install en_core_web_sm but if fails, this does not seem like this package is available on Pypi, so I assume it wouldn’t do anything inside the requirements.txt file :confused:. Or maybe it’s a private package on another private Pypi server ?

This en_core_web_sm though does look like a Spacy model. So maybe this would do as a workaround:

  1. Install spacy, by putting it in the requirements.txt file.
  2. Load en_core_web_sm through Spacy:
import spacy
nlp = spacy.load("en_core_web_sm")


The documentation says you need to:

python -m spacy download en_core_web_sm

Alternatively, you can install from the URL (which you should be able to include into a requirements.txt file):

pip install
1 Like

I tried all the possible combinations but it is not working.

I am now trying to run a separate script from spacy streamlit documentation page but still getting the same error.

Here is the link for the app.

and I have taken the code from here

I have wasted so much time on this. I really appreciate any pointer.

Tried this, didn’t work!

Looks like this works on the requirements.txt

en_core_web_sm @

1 Like

This worked!

1 Like