TkinterWeb icon indicating copy to clipboard operation
TkinterWeb copied to clipboard

Linux 32-bit - libopenjp2-7 is required but not installed - ModuleNotFoundError

Open WGandy opened this issue 2 years ago • 4 comments

When installing on a Raspberry Pi Zero running Raspberry Pi Os Lite (bullseye) with Openbox and LightDM installed... On first use of tkinterweb I encountered a ModuleNotFoundError. I tweaked the tkinterweb constructor file (init.py) to get a bit more detail about the error and found the issue was (at least initially) occurring in the bindings.py file.

sudo apt install libopenjp2-7 fixed the issue. So it seems that tkinterweb depends on this but does not check for it when being installed.

WGandy avatar Nov 27 '21 16:11 WGandy

Just to clarify, do you have Tkinter, PIL, and PIL-ImageTk installed?

Andereoo avatar Nov 28 '21 13:11 Andereoo

Interestingly, none of those package show up with pip3 list Tkinter is obviously installed because I can run tkinter._test() and get a window.
And I thought that PIL is installed with pillow (or in lieu of). pillow is indeed listed as one of the installed pip packages

I was curious so... I used sudo apt install python3-pil and it did install some stuff. The following NEW packages will be installed: file libimagequant0 libmagic-mgc libmagic1 libwebpdemux2 mailcap mime-support python3-olefile python3-pil

Running sudo apt install python-pil.imagetk gave me an error that it can't find the package. Isn't this installed with pil/pillow?

WGandy avatar Nov 29 '21 19:11 WGandy

In my experience, ImageTk is a bit of a funny package because on some distributions it comes installed with PIL but in others it isn't. In Windows, for example, running pip install Pillow automatically installs ImageTk. On ArchLinux, sudo pacman -S python-pillow automatically installs ImageTk. On Ubuntu, you have to run sudo apt-get install python3-pil python3-pil.imagetk to install ImageTk alongside PIL - otherwise it won't be installed. I don't have much experience with Raspberry Pi. Maybe try installing python-imaging and python-imaging-tk.

Andereoo avatar Nov 29 '21 19:11 Andereoo

@WGandy Does installing python-imaging and python-imaging-tk work for you?

Andereoo avatar Dec 13 '21 14:12 Andereoo