Closed gitting closed 1 month ago
Same issue
And many thanks @gitting for the workaround :+1:
there might be a good reason (pillow is using native code afaik, which might fail sometimes, so that might be the reason for making it optional). @raphael0202 any opinions
I missed this issue, sorry for that! We support a degraded version of openfoodfacts-python without Pillow (if you don't need image processing, no need to have Pillow installed). I've just released a new version of openfoodfacts-python (1.1.3) that fixes this issue.
I'm closing this issue as it works locally without Pillow, but feel free to reopen if the issue persists.
What
Running
pip install openfoodfacts
results with the following in a freshvenv
:pillow
is not in the list, hence attempts to use the API result in the following:After
pip install pillow
the list looks as follows:and the API works.
Steps to reproduce the behavior:
python3 -m venv .venv
source .venv/bin/activate
pip install openfoodfacts
pillow
is missingExpected behavior
pillow
should be installed as a required dependency.Could it be because of the
optional = True
key set in this line? https://github.com/openfoodfacts/openfoodfacts-python/blob/8d1013a01c8fa674c1c84fd1729b73c621b5edd3/pyproject.toml#L26Platform (Desktop, Mobile, Hunger Games)