-1

I added pyenchant to my requirements files then I tried adding this in my dockerfile (python version 3.10) (this worked on version 3.7 but not now):

RUN apt install --yes libenchant-2-2

RUN apt-get install -y gdebi
RUN curl -sLO http://ftp.de.debian.org/debian/pool/main/e/enchant/libenchant1c2a_1.6.0-11.1+b1_amd64.deb && gdebi -n libenchant1c2a_1.6.0-11.1+b1_amd64.deb

but i tried to import enchant got this error

No module named 'enchant'

And when i tried this

RUN apt install --yes libenchant1c2a

the error was files not found

Any idea how to install it ?

None
  • 17
  • 4

1 Answers1

0

You should include your entire dockerfile including the specific base image. I was able to import enchant with this dockerfile.

You could replace the CMD line with something like CMD ["python", "-u", "main.py"] to run your file.

FROM python:3.10.5-slim-buster

RUN apt update && apt install -y libenchant-dev
RUN pip install pyenchant
CMD ["python", "-c", "'import enchant'"]