6

I tried using the pre-built wheels for Pillow and corresponding libraqm DLL from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow

But the following returns False:

from PIL import features
features.check('raqm')

Am I missing anything?

Context: I need libraqm with Pillow to work with complex fonts on images, as shown here.

2
  • 4
    Place the 32/64-bit libraqm.dll and fribidi-0.dll next to 32/64-bit python.exe
    – cgohlke
    Jul 16, 2020 at 16:42
  • 1
    Works now, I was placing it in C:\Windows\System32 as we generally do with most DLLs. Thanks a lot, both for the help and your binaries!! :)
    – Gokul NC
    Jul 16, 2020 at 16:47

3 Answers 3

12

For anyone who wants RAQM with PIL on Windows, just do pip install Pillow.

Then place the libraqm DLLs in some directory, and then append that directory to environment/shell variable PYTHONPATH. That's it.

Or you could place those DLLs along with your python.exe as commented by @cgohlke.


Just in-case someone wants to know, I'm currently on Python 3.7 (Windows 10) with Pillow 7.2.0 and libraqm-0.7.0.dll

6
  • 3
    I think this should be stated somewhere officially. It's kinda hard to find this answer although the solution was simple
    – GTHell
    Sep 2, 2020 at 17:01
  • It won't be stated officially, because it is not an official build.
    – Gokul NC
    Sep 3, 2020 at 6:04
  • @GokulNC I did as mentioned here. Installed Pillow using pip Took the x64 DLLs from the path and pasted them next to python.exe at C:\Python39\ But I still get "False" when I check for raqm feature. And get no text when using PIL to draw Hindi/Telugu text on images Windows 10, Python 3.9 and Pillow 8.2.0 Can you please help?
    – cvipul
    Apr 30, 2021 at 19:34
  • @cvipul The 8.2.0 and 8.3.0 releases were built without Raqm support, you should upgrade to 8.3.1. See the discussion starting here: github.com/python-pillow/Pillow/issues/…
    – Nulano
    Aug 3, 2021 at 16:00
  • Thanks @Nulano let me upgrade and check. I remember 8.2.0 working on linux with raqm, which the thread also says. So I assumed it would work in windows too.
    – cvipul
    Aug 9, 2021 at 11:29
1

Just some extra information about Gokul NC answer.

I tried adding the folder path where I put the libraries to PYTHONPATH but it did not work for me. What it worked for me was adding the folder path to PATH.

There is an important difference between them. PYTHONPATH will be used for Python to search for modules whereas PATH will be used for Windows to dynamically load dlls.

1

Just to add a further data point:

@GokulNC's answer didn't work on Python 3.10 with Pillow 9.5.0 (most recent at the time of writing).

Using Python 3.7 with Pillow 8.0.0 does work as described, when adding a folder including the x64 versions of the two dlls to the PATH variable.

I'm on Windows 11.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.