Cannot install packages.txt

Hi!

I am trying to install dependencies using packages.txt. However, the log has only these lines related to it, and it is not possible to see whether the packages are getting installed at all.

--> COPY packages.txt /root/packages.txt
DONE 0.1s

--> RUN apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [34.8 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [408 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
Fetched 8539 kB in 1s (7326 kB/s)
Reading package lists...
DONE 1.7s

My packages.txt:

libenchant1c2a

Log from my app which uses pyenchant:

Traceback (most recent call last):
  File "app.py", line 1, in 
    from features import FeatureGenerator
  File "/home/user/app/features.py", line 5, in 
    import enchant
  File "/home/user/.local/lib/python3.8/site-packages/enchant/__init__.py", line 81, in 
    from enchant import _enchant as _e
  File "/home/user/.local/lib/python3.8/site-packages/enchant/_enchant.py", line 157, in 
    raise ImportError(msg)
ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See  https://pyenchant.github.io/pyenchant/install.html
for details

hi @alex42t

quick look and test I guess what you’re looking for on our Debian container is the following package

packages.txt

python3-enchant

requirements.txt*

pyenchant

Tested with this and worked

import enchant
d = enchant.Dict("en_US")
print(d.check("Hello"))

Hi @radames !

Can you clarify, should it be package.txt or packages.txt? Btw, I am using Gradio SDK.
Unfortunately, specifying python3-enchant in packages.txt does not help. On Kaggle I was able to install libenchant1c2a .
But now I have this error (probably unrelated to the topic)

error: failed to receive status: rpc error: code = Unavailable desc = error reading from server: command [kubectl --context= --namespace= exec --container= -i buildkit-prod-s3-3 -- buildctl dial-stdio] has exited with exit status 137, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=command terminated with exit code 137

Sorry, I meant to say packages.txt

Here is a live demo. Hello Py Enchant - a Hugging Face Space by radames

Please try Settings/Factory Reboot

Thanks! Creating a new Space and specifying python3-enchant in packages.txt resolved the issue.

1 Like