Acording to the answer of Denis Cornehl I add an Aptfile
to the project with this content:
libenchant-dev
And that removed the error of the C library.
However in my case I can't find a way of add a spanish dictionary, I tried add myspell-es
in the same Aptfile, but without success.
UPDATE: Since I was having problems with the spanish dictionary. I stopped trying to deploy that way and I use a Dockerfile. This way I have more control of which OS libraries install. With this Dockerfile I was able to use pyenchant with a spanish dictionary (By the way, my app uses Flask, for that the CMD command uses gunicorn):
FROM python:3.8-slim-buster
WORKDIR /
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install libenchant-dev hunspell hunspell-es
COPY requirements.txt .
COPY app.py .
RUN pip install -r requirements.txt
CMD gunicorn --bind 0.0.0.0:$PORT app:app
And the way to deploy it is slightly different:
heroku login
heroku create <your_app_name>
heroku container:login
heroku container:push web --app <your_app_name>
heroku container:release web --app <your_app_name>
I hope this helps you.