Mod-sdk - Ubuntu Studio - PIL problems - zip decoder

ERROR:tornado.application:Uncaught exception GET /screenshot?uri=http%3A%2F%2Fll-plugins.nongnu.org%2Flv2%2Flv2pftci%2Fsilence&width=230&height=431 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:9000', method='GET', uri='/screenshot?uri=http%3A%2F%2Fll-plugins.nongnu.org%2Flv2%2Flv2pftci%2Fsilence&width=230&height=431', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Referer': 'http://localhost:9000/', 'Host': 'localhost:9000', 'Accept-Language': 'en-US,en;q=0.5', 'X-Requested-With': 'XMLHttpRequest', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0', 'Connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate'})
Traceback (most recent call last):
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/PIL/Image.py", line 415, in _getdecoder
    decoder = getattr(core, decoder_name + "_decoder")
AttributeError: module 'PIL._imaging' has no attribute 'zip_decoder'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/tornado/web.py", line 1302, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
  File "<string>", line 3, in raise_exc_info
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 314, in wrapped
    ret = fn(*args, **kwargs)
  File "/home/andrewcapon/ModDuo/mod-sdk/modsdk/webserver.py", line 389, in proc_callback
    self.handle_image(fh)
  File "/home/andrewcapon/ModDuo/mod-sdk/modsdk/webserver.py", line 405, in handle_image
    img = self.crop(img)
  File "/home/andrewcapon/ModDuo/mod-sdk/modsdk/webserver.py", line 443, in crop
    for i, px in enumerate(img.getdata()):
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/PIL/Image.py", line 1141, in getdata
    self.load()
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/PIL/ImageFile.py", line 203, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/home/andrewcapon/.local/lib/python3.5/site-packages/PIL/Image.py", line 419, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
OSError: decoder zip not available
ERROR:tornado.access:500 GET /screenshot?uri=http%3A%2F%2Fll-plugins.nongnu.org%2Flv2%2Flv2pftci%2Fsilence&width=230&height=431 (127.0.0.1) 5651.50ms

Hi Guys,

I’m banging my head against the walls here on this one, I have installed everything zip released I can think of, I have added symbolic links, and I have uninstalled pillow and reinstalled it.

Anyone any ideas?

Cheers

Andy

you built the modules yourself right?
seems like it doesn’t have zip support, so probably a package dependency missing during build.

Hi,

Thanks for the reply

I didn’t build python3-pil but I did build mod-sdk.

So you think the issue is with my mod-sdk build then?

Thanks

Andy

But you have a file like /home/andrewcapon/.local/lib/python3.5/site-packages/PIL/ImageFile.py
Which is in your home folder.

How did you install python3-pil?
Something on that step needs tweaking.

Hi Again,

Everything was installed per the instructions here: https://github.com/moddevices/mod-sdk

so:

sudo apt-get install liblilv-dev phantomjs python3-pil python3-pystache python3-tornado
python3 setup.py build

Ok I just built pillow:

--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 3.5.0.dev0
platform     linux 3.5.2 (default, Nov 17 2016, 17:05:23)
             [GCC 5.4.0 20160609]
--------------------------------------------------------------------
--- JPEG support available
--- OPENJPEG (JPEG2000) support available (2.0)
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
--- LIBTIFF support available
--- FREETYPE2 support available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
--------------------------------------------------------------------

So that looks good.

I install the version that I built and I still get the same error.

I have managed to keep away from python all my life so I’m not sure whats going on, would the install that I just built be going to a different place than /home/andrewcapon/.local/?

Aha, got it working.

I uninstalled the pip version.

Installed the version I built, added /usr/local/lib to /etc/ld.so.conf and can now generate graphics.

So I guess the python3-pil in the ubuntu repositories just doesn’t support zlib

The Python versions shipped by the distributions are often horribly outdated. Or if you want to look at it another way: the ecosystem is evolving at a high speed. :smiley: Personally, I use the Anaconda package manager to keep things fresh.

@falkTX: how do you keep your Python stuff up-to-date?

I do my own packaging when needed, which often goes into the kxstudio repository if it doesn’t break anything.
I use Ubuntu 14.04, don’t know if others (more recent ubuntu) have the right stuff.
So far I needed these packages, https://launchpad.net/~kxstudio-debian/+archive/ubuntu/ubuntus/+packages?field.name_filter=py&field.status_filter=published&field.series_filter=

Nice! :+1: :+1: :+1: