ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied

Hello everyone, i am a beginner on streamlit and I need your help with fixing an issue that I couldn’t fix even with ChatGPT :smiley:

I am having an issue with deploying my Streamlit app. i am trying to use a spaCy model with my streamlit app and here is the code:
‘’’
try:
nlp = spacy.load(“en_core_web_md”)
except:
spacy.cli.download(‘en_core_web_md’)
nlp = spacy.load(“en_core_web_md”)
‘’’

the purpose of this part of the code is to import the spaCy library then check if the “en_core_web_md” model is installed or not and if not it should install it.

The code runs smoothly on my local machine with no errors, however, when I uploaded my files to github and deployed the app I get this error message

Installing collected packages: en-core-web-md

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.12/site-packages/en_core_web_md'

Check the permissions.

how can I fix this issue?
Thank you in advance.

I tried installing it locally, and noticed that the url that actually gets installed is this one

If you try pip install https://github... with that url, it should work

So, to make it accessible on streamlit community cloud, you can add that url https://....whl to your requirements.txt along with spacy. It’s not the ideal solution, but should work.

1 Like

(post deleted by author)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.