Problem in downloading/installing Spacy model

When I try to run the following instructions:

import spacy
subprocess.run([f"{sys.executable}", "-m","spacy","download","en_core_web_sm"])
nlp_en = spacy.load('en_core_web_sm')

I get the following message:

Installing collected packages: fr-core-news-sm
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 
/home/adminuser/venv/lib/python3.9/site-packages/fr_core_news_sm'
Check the permissions.

What can I do to get the permissions ou to solve this problem ?

Hey I am also new to this but I would suggest to that to add --user and check once like I think there is some issue regarding need for administrator permissions and --user will bypass it via downloading it for only current user.

Like when installing spacy in cmd write:
pip install --user spacy

If this dosnt work then could you just tell me that you are using venv or not?
Hope, this helps :crossed_fingers:

Please provide precise information: Where is this run, locally or on Streamlit Cloud?

Hello Franky1
On Streamlit Cloud (I don’t have problem locally).

Hello,
my problem is on the Streamlit community and I don’t know if I can put --user spacy in requirement.txt…

You can also specify the models in the requirements.txt file, as in this example here, but don’t copy them blindly:

Thank youn Franky1, I appreciated your help. I think my problem is solved thanks to you

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