Compiling with libimagequant dependency
After trying to compile pillow with libimagequant dependency enabled, i still get the same error.
Please can you paste the full traceback as text?
The user also posted these images in Gitter, with the text
im trying to compile pillow with libimagequant but everytime i try to quantize with Quantize.LIBIMAGEQUANT method i get an error.
What operating system are you using? What library are you using that is emitting the "Uhandled error when trying to build the pallete"? Are you able to post a complete example of the code that you're running?
Please can you paste the full traceback as text?
Traceback (most recent call last):
File "/root/MiaBot/.venv/lib/python3.11/site-packages/jishaku/features/python.py", line 190, in jsk_python
async for send, result in AsyncSender(executor): # type: ignore
File "/root/MiaBot/.venv/lib/python3.11/site-packages/jishaku/functools.py", line 124, in _internal
value = await base.asend(self.send_value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/MiaBot/.venv/lib/python3.11/site-packages/jishaku/repl/compilation.py", line 214, in traverse
yield await func_a(*self.args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "<repl>", line 5, in _repl_coroutine
img.quantize(10, method=Image.Quantize.LIBIMAGEQUANT, dither=0)
File "/root/MiaBot/.venv/lib/python3.11/site-packages/PIL/Image.py", line 1167, in quantize
im = self._new(self.im.quantize(colors, method, kmeans))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: dependency required by this method was not enabled at compile time
The user also posted these images in Gitter, with the text
im trying to compile pillow with libimagequant but everytime i try to quantize with Quantize.LIBIMAGEQUANT method i get an error.
What operating system are you using? What library are you using that is emitting the "Uhandled error when trying to build the pallete"? Are you able to post a complete example of the code that you're running?
Im using ubuntu Ubuntu 20.04.6 LTS x86_64
from PIL import Image
buf=io!.BytesIO(await author.avatar.read())
with Image.open(buf) as img:
img.quantize(10, method=Image.Quantize.LIBIMAGEQUANT, dither=0)
Have you tried uninstalling Pillow, checking that it is not installed by seeing that it fails to import, and then tried installing again?
When I try python3 -m pip install --upgrade Pillow -C imagequant=enable --no-cache-dir on my macOS machine, it still uses the precompiled wheel.
Try adding --no-binary :all: as another argument to the command.
python3 -m pip install --upgrade Pillow -C imagequant=enable --no-cache-dir
yes that worked, thank you :)