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.

Gokul NC
  • 1,111
  • 4
  • 17
  • 39
  • 4
    Place the 32/64-bit `libraqm.dll` and `fribidi-0.dll` next to 32/64-bit `python.exe` – cgohlke Jul 16 '20 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 '20 at 16:47

3 Answers3

11

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

Gokul NC
  • 1,111
  • 4
  • 17
  • 39
  • 3
    I think this should be stated somewhere officially. It's kinda hard to find this answer although the solution was simple – GTHell Sep 02 '20 at 17:01
  • It won't be stated officially, because it is not an official build. – Gokul NC Sep 03 '20 at 06: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 '21 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: https://github.com/python-pillow/Pillow/issues/4859#issuecomment-873110296 – Nulano Aug 03 '21 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 09 '21 at 11:29
  • placing Dlls works perfectly fine .. – geekonweb Jul 24 '23 at 05:26
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.

Manu S2
  • 11
  • 1
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.