1

When I do:

from PIL import Image

It gave:

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

There is a similar question that suggests to do

sudo apt-get install libopenjp2-7-dev

However, in my case, it is not doable since I'm operating a remote computation system and I am not able to do sudo command. Since I found there are many .so files in lib directory under Miniconda, I wonder whether can I install this libopenjp2.so.7 via conda install? How?

Stefan van der Walt
  • 7,165
  • 1
  • 32
  • 41
Kunyu Shi
  • 197
  • 3
  • 10
  • 1
    A *.so file is a shared object. Conda should install all dependencies. Can you open a prompt, do "conda list" and post the output here? – Dschoni Apr 16 '18 at 12:49
  • Here's a list of [all external libraries](https://pillow.readthedocs.io/en/5.1.x/installation.html#external-libraries) used by Pillow. These should be installed before executing Pillow commands. And if they are not present on standard path (which I doubt coz you dont have admin privileges), require additional commands in Pillow to work. Have you tried searching the system if `libopenjp2` is present or not. – Vivek Kumar Apr 16 '18 at 15:41
  • @Dschoni Yes you are right, conda install can solve dependencies. However, due to the reason that I have to use virtualenv not conda env, pip install is the only choice.(Some pre-built wheels on HPC are only available in virtualenv) – Kunyu Shi Apr 17 '18 at 02:34
  • @Vivek Kumar I did search by using find . -name "libopenjp2*", but I can't find this object. There is also no libopenjp2 in the link you provided. – Kunyu Shi Apr 17 '18 at 03:00
  • The above link has `'openjpeg'`. openjp2 is an library in that. – Vivek Kumar Apr 17 '18 at 04:35

0 Answers0