israel-dryer/ttkbootstrap

ttkcreator not opening due to wrong attribute

MrManini opened this issue · 5 comments

ttkcreator not opening due to wrong attribute

ttkbootstrap v1.10.1
OS: Windows 10

Describe the bug

When opening the ttkcreator using python -m ttkcreator, the program doesn't run, due to an error in line 856 of widgets.py

img.resize((self._metersize, self._metersize), Image.CUBIC)
^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'CUBIC'. Did you mean: 'BICUBIC'?

To Reproduce

Run and open the ttkcreator using python -m ttkcreator on the terminal.

I get exactly the same issue. It might have something to do with PIL's replacement "pillow' when opening/using 'Meter' You can get past this by editing ~/*/site-packages/ttkbootstrap/widgets.py and putting lines 855 to 858 in an exception block ....

try:
self._meterimage = ImageTk.PhotoImage(
img.resize((self._metersize, self._metersize), Image.CUBIC)
)
self.indicator.configure(image=self._meterimage)
except Exception as e:
print("Exception",e)

Duplicate of #472, and a bunch of others.

The issue was resolved by the merge of #490. Please close it.