Kodi Community Forum

Full Version: The _imaging C module is not installed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. One of user my addon have problem with Image package.

He using openelec:

Code:
13:49:29   7.824651 T:140141752924224  NOTICE: Starting Kodi (17.0-ALPHA1 Git:61e14b1). Platform: Linux x86 64-bit
13:49:29   7.824670 T:140141752924224  NOTICE: Using Release Kodi x64 build
13:49:29   7.824691 T:140141752924224  NOTICE: Kodi compiled Jan 12 2016 by GCC 5.3.0 for Linux x86 64-bit version 4.4.0 (263168)
13:49:29   7.824833 T:140141752924224  NOTICE: Running on OpenELEC (Milhouse) - Version: devel-20160112225428-#0112-g6b32250 [Build #0112] 7.0, kernel: Linux x86 64-bit version 4.4.0

and get error:

Code:
13:50:53  90.577278 T:140139041027840   DEBUG: >>>> Movielib <<<< The _imaging C module is not installed

It is a pice of my addon code:

Code:
import xbmc
import xbmcaddon
import os
from PIL import Image
from PIL.Image import core as _imaging
import cStringIO
import json
import urllib

[...]

        try:
            image = Image.open(file)
            if image.mode != 'RGB':
                image = image.convert('RGB')
            h = image.size[1]
            if h > 10:
                if (h > height):
                    image.load()
                    image = image.resize((width, height), Image.ANTIALIAS)
                image_bin = cStringIO.StringIO()
                image.save(image_bin, 'JPEG', quality=int(q))
                output = image_bin.getvalue()
                image_bin.close()
        
        except Exception as Error:
            debug.debug(str(jsonGetResponse))
            debug.debug(source)
            debug.debug(str(Error))

addon.xml:
Code:
<requires>
    <import addon="xbmc.python" version="2.14.0" />
    <import addon="script.module.pil" version="1.1.7" />
</requires>

What is a problem?
it tells you exactly what is the problem.

you have to do the distro's equivalent of sudo apt-get install python-imaging
(2016-01-15, 15:09)ironic_monkey Wrote: [ -> ]it tells you exactly what is the problem.

you have to do the distro's equivalent of sudo apt-get install python-imaging

i wish it would be that easy on an Openelec.... Big Grin
bit more time now.

to give some details; in krypton script.module.pil is just a wrapper around pillow which depends on the standard imaging library in python 2.7. seem openelec hasn't adjusted to that change yet. ref https://github.com/xbmc/xbmc/commit/1ce9...6eef62433b
The version of OpenELEC reported in post #1 does include Pillow and _imaging.so (/usr/lib/python2.7/site-packages/PIL/_imaging.so) - what adjustment needs to be made, exactly?