Pillow: libopenjp2.so.7: cannot open shared object file: No such file or directory

27,019

What worked for me was running :

sudo apt-get install libopenjp2-7

Good Luck!

Share:
27,019
Simon Carlson
Author by

Simon Carlson

Engineering student from Sweden. #SOreadytohelp

Updated on May 30, 2020

Comments

  • Simon Carlson
    Simon Carlson almost 4 years

    I have a fresh, minimal Raspbian Stretch install. I have installed the PIXEL-dekstop by running sudo apt-get install --no-install-recommends xserver-xorg and am now trying to use Pillow in Python. Pillow was installed by running sudo apt-get install pip3 and then sudo pip3 install Pillow. Whenever I try from PIL import Image I get the error ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory.

    I have attempted to reinstall Pillow under different versions but it does not help. I have also enabled apt-get sources in /etc/apt/sources.txt and ran sudo apt-get build-dep python-imaging, which also did not help. Any help is appreciated.

    Python version: 3.5.3, current Pillow version: 4.3.0