Heroku Deployment Error: No matching distribution found for en-core-web-sm
Asked Answered
T

4

8

I am trying to deploy my Django and spaCy project to Heroku. But I am getting an error: No matching distribution found for en-core-web-sm (It is an ML model downloadable via pip). How can I solve this problem? The model is installed locally in a virtual environment and working alright. I got the requirements file via pip freeze. I am using Python 3.6.4.

Thorman answered 7/5, 2019 at 18:40 Comment(0)
C
3

It doesn't look like pip install en-core-web-sm works either, so I'm wondering how you installed it locally?

One possible solution is to get it from github instead of pypi, by adding this line in requirements.txt instead

-e https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz#egg=en_core_web_sm
Candicecandid answered 7/5, 2019 at 18:52 Comment(4)
I downloaded it via pip but the build failed because I didn't have C++ build tools required. So I downloaded the binaries directly (locally). Now I have just tried your solution to deploy and got another error message: github.com/explosion/spacy-models/releases/download/… should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+Thorman
Try removing the -eCandicecandid
It almost worked! But is there a way to get a smaller size model because the slug size exceeded? 751.2M is too large (max is 500M).Thorman
After some looking around, I think you could try this link instead: https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz#egg=en_core_web_sm==2.1.0Candicecandid
D
1

Simply add the following line into your 'requirements.txt' file...

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

Or, to get the exact version, run the following command:

pip freeze

and copy the similar line that you find in your command prompt.

Dependency answered 6/5, 2021 at 2:28 Comment(0)
X
0

I found an alternative to install en_core_web_sm on Heroku and have not found any side effects yet, which is editing the Profile in this way:

web: sh setup.sh && python -m spacy download en_core_web_sm && streamlit run app.py

Just tell me if everyone finds it is not available anymore.

Xeric answered 12/8, 2020 at 1:27 Comment(0)
M
0
python -m spacy download en_core_web_sm

The release page on Github had this command to install the package. This method worked for me in pipenv version 2023.2.18 and python version 3.10.4. The pipfile.lock was updated with en-core-web-sm==3.4.1. I'm working in GitHub codespaces. https://github.com/explosion/spacy-models/releases/tag/en_core_web_sm-3.5.0

Myceto answered 29/4, 2023 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.