Upgrading Python Pillow package

  • Hi,
    I'm attempting to upgrade the Pillow python library to try using the luma.oled library to control an OLED and can't figure out how to update Pillow.

    Any help describing the process on how to upgrade the package would be appreciated.

    I'm using Python 2.7. I'm using an SD card and increased RAM using a partition on the SD card. I've tried installing gcc, updating setuptools, and using easy_install. The error message for pip is below:

    root@Omega-0F89:/# pip install --upgrade Pillow
    Collecting Pillow
    Downloading https://files.pythonhosted.org/packages/3c/7e/443be24431324bd34d22dd9d11cc845d995bcd3b500676bcf23142756975/Pillow-5.4.1.tar.gz (16.0MB)
    100% |████████████████████████████████| 16.0MB 10kB/s
    Installing collected packages: Pillow
    Found existing installation: Pillow 3.3.1
    Uninstalling Pillow-3.3.1:
    Successfully uninstalled Pillow-3.3.1
    Running setup.py install for Pillow ... error
    Rolling back uninstall of Pillow
    Command "/usr/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-Cr0njc/Pillow/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-gySyEe/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-Cr0njc/Pillow/
    root@Omega-0F89:/# root@Omega-0F89:/#


  • Turns out pillow requires zlib and jpeg. You need to install zlib-dev "opkg install zlib-dev". I was unable to find jpeg. I assume there's a way to do that but I haven't ventured far enough into this to be able to try that. You can get around the jpeg requirement by disabling it in the installation arguments.

    pip3 install --upgrade pillow --global-option="build_ext" --global-option="--disable-jpeg"

Log in to reply

Looks like your connection to Community was lost, please wait while we try to reconnect.