Search code examples
python-2.7shared-librariesosx-yosemitepython-imaging-librarycups

'The _imagingft C module is not installed' when called by CUPS (_lp or root)


OSX: 10.10.5
Python: 2.7
pip freeze: PIL==1.1.7, Pillow==2.0.0
brew list: freetype

I have a Python script running as a CUPS backend in /usr/libexec/cups/backend. It runs fine when I call it as a user or root from a terminal prompt...but comes up with an error when CUPS calls it via the printer.

ERROR

The _imagingft C module is not installed

Again, this error does not happen when running it from a terminal prompt as either root or a user.

I have tried having cups run it as both _lp, and as root by changing the permissions on the backend file to 755 and 750 respectively. Watching a 'ps' confirms that when 755 it runs as _lp (user 26) and when set to 750 it runs as root (user 0).

Freetype, libjpg, PILlow, etc. all apear to be installed correctly via either pip or homebrew.

I'm at a loss.

  1. What am I missing.

  2. Is there a way to change the user when it runs from CUPS (although, again, when I run it as root from a terminal prompt, it runs fine).

  3. Path'ing issue? Where would I correct this for CUPS?

Thanks.

I have also tried...

brew unlink freetype && brew link --overwrite freetype

To no effect.


Solution

  • Try installing Pillow through Python Wheels:

    pip install --upgrade pip
    pip install wheel
    pip uninstall Pillow
    pip install --use-wheel Pillow