I’m trying to deploy my classification model and the process requires spaCy, but the model download fails. I’ve tried the suggestions I saw in the community already, and none of them work for me. I can’t share my github because it’s something I’m trying for work , but I’ll add the log message I got and what I tried.
I’m seeing this error message in the log message:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.13/site-packages/en_core_web_sm'
Check the permissions.
[notice] A new release of pip is available: 24.0 -> 25.1.1
[notice] To update, run: python3 -m pip install --upgrade pip
Collecting en-core-web-sm==3.8.0
Since you are showing errors in your app, are you trying to modify your environment through subprocesses after your app is deployed? Or do you have all your dependencies set in requirements.txt and packages.txt? What are you environment configuration files?
Hi…So yes after I ent the text it would modify. I have all my dependencies set up in my requirements.txt and a model_utils.py file that’s trying to load the spaCy model. I didn’t have an environment configuration file. Is that required?.. I’m mainly worried about the spaCy model not being detected.
You’ll need to make sure any pip install commands are handled when the container is set up, which means putting everything you need in requirements.txt and not using a subprocess inside your app. requirements.txt is one possible environment configuration file (for things installed from PyPi). And it sounds like you do have that one? Additionally, packages.txt is something that can install Linux dependencies if you have other, non-Python things to install.
From your error message, it seems you’re facing a permission issue when trying to install the en_core_web_sm model. This usually happens when you’re attempting to install in a restricted directory. Try installing it with the --user flag so the installation happens at the user level, like this: python -m spacy download en_core_web_sm --user. If you have sudo access, you can also try using sudo. Additionally, make sure your virtual environment is properly activated and you’re working in a directory where you have write permissions. Hopefully, this will help.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.