israel-dryer / ttkbootstrap

A supercharged theme extension for tkinter that enables on-demand modern flat style themes inspired by Bootstrap.
MIT License
1.76k stars 353 forks source link

module 'PIL.Image' has no attribute 'CUBIC'. Did you mean: 'BICUBIC'? #566

Open mas6y6 opened 2 months ago

mas6y6 commented 2 months ago

Desktop (please complete the following information):

Windows 11 Home ttkbootstrap 1.10.1 (Latest version)

Describe the bug

In widgets file it there is an undefined variable in widgets.py PIL.CUBIC it needs to PIL.BICUBIC which is preventing using the meter widget:

Just replace this file with this one: widgets.zip

   else:
            self._draw_solid_meter(draw)

        self._meterimage = ImageTk.PhotoImage(
            img.resize((self._metersize, self._metersize), Image.BICUBIC)
        )
        self.indicator.configure(image=self._meterimage)

OLD

   else:
            self._draw_solid_meter(draw)

        self._meterimage = ImageTk.PhotoImage(
            img.resize((self._metersize, self._metersize), Image.CUBIC) #Image.CUBIC is undefined
        )
        self.indicator.configure(image=self._meterimage)

To Reproduce

On Version 1.10.1 just type this in terminal:

python -m ttkbootstrap

Then you will get the error

Expected behavior

The expected behavior is that the python -m ttkbootstrap is supposed to load

Screenshots

No response

Additional context

widgets.zip

fooblart commented 2 months ago

@israel-dryer can you please fix this on pypi.org please, EVERY user that wants to use this library has this issue :(

rdbende commented 2 months ago

People who really want this can still use an older PIL version or use ttkbootstrap directly from this repo, but demanding an update of the Pypi package is rather pointless, given that israel-dryer has not been available here for over a year.

fooblart commented 2 months ago

Yes i understand now, my bad. it is a pretty easy fix to be honest as you just need to manually edit the file yourself and replace it, but it would be nice to see it be replaced as this is a very good project otherwise.