Bokeh installation on Raspberry Pi 3

0

Hi have any one tried installing Bokeh on a Raspberry Pi?

I get this error when I try to generate a plot into an html file:

python3 test1.py 
Traceback (most recent call last):
  File "test1.py", line 1, in <module>
    from bokeh.plotting import figure, output_file, show
  File "/usr/local/lib/python3.5/dist-packages/bokeh/plotting/__init__.py", line 57, in <module>
    from . import figure as _figure
  File "/usr/local/lib/python3.5/dist-packages/bokeh/plotting/figure.py", line 26, in <module>
    from ..core.properties import Any, Auto, Either, Enum, Int, List, Seq, Instance, String, Tuple
  File "/usr/local/lib/python3.5/dist-packages/bokeh/core/properties.py", line 255, in <module>
    from .property.dataspec import AngleSpec; AngleSpec
  File "/usr/local/lib/python3.5/dist-packages/bokeh/core/property/dataspec.py", line 40, in <module>
    from .visual import FontSize, MarkerType
  File "/usr/local/lib/python3.5/dist-packages/bokeh/core/property/visual.py", line 29, in <module>
    import PIL.Image
  File "/usr/local/lib/python3.5/dist-packages/PIL/Image.py", line 94, in <module>
    from . import _imaging as core
ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory

It's now installed with pip3 but I have also tried pip, it's installed on a vanilla RPI image.

To me it seems like a package is missing, but I'm not a Python and also Bokeh expert.

Mads Munk

Posted 2019-03-23T16:45:19.317

Reputation: 1

Answers

0

A .so file(shared object) is a compiled library file in Linux - akin to Windows' DLL(dynamic linked library) files. It looks like one of the dependencies in your project requires the libopenjp2.so.7 library. Try making sure it's installed with:

sudo apt-get install libopenjp2-7

You could then try checking the Linux shared library cache to see if it's in there.

ldconfig -p | grep 'libopenjp2.so.7'

Which should give you something like:

libopenjp2.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopenjp2.so.7

If you don't see anything, try updating the cache with:

sudo ldconfig

baelx

Posted 2019-03-23T16:45:19.317

Reputation: 2 083

Still getting the same result, I have tried uninstalling libopenjp2-7 and reinstalling it just to be sure. – Mads Munk – 2019-03-25T16:44:08.967

Odd, but you might need to update your so cache. Editing. – baelx – 2019-03-25T17:08:10.133

1Now it works I tried a clean install, when bokeh was installing it failed installation of Pillow. The reason for that fail was libjpeg, so thanks for help :-) – Mads Munk – 2019-04-07T18:08:14.133