israel-dryer/ttkbootstrap

Cannot run TTK Creator

Closed this issue · 1 comments

Desktop (please complete the following information):

Windows 11
ttkbootstrap version: 1.10.1

Describe the bug

Hi,

I installed ttkbootstrap and using the themes and widgets without issues in my code. However, when I want to run TTK Creator, I get the following error. Any issues how I might go about solving it.

Thanks in advance, cheers...

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python312\Lib\site-packages\ttkcreator\__main__.py", line 471, in <module>
    creator = ThemeCreator()
              ^^^^^^^^^^^^^^

  File "C:\Python312\Lib\site-packages\ttkcreator\__main__.py", line 23, in __init__
    self.demo_widgets = DemoWidgets(self, self.style)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python312\Lib\site-packages\ttkcreator\__main__.py", line 245, in __init__
    self.create_left_frame()
  File "C:\Python312\Lib\site-packages\ttkcreator\__main__.py", line 445, in create_left_frame
    m = ttk.Meter(
        ^^^^^^^^^^

  File "C:\Python312\Lib\site-packages\ttkbootstrap\widgets.py", line 718, in __init__
    self._setup_widget()
  File "C:\Python312\Lib\site-packages\ttkbootstrap\widgets.py", line 759, in _setup_widget
    self._draw_meter()
  File "C:\Python312\Lib\site-packages\ttkbootstrap\widgets.py", line 856, in _draw_meter
    img.resize((self._metersize, self._metersize), Image.CUBIC)
                                                   ^^^^^^^^^^^

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

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response

I was able to fix the issue and I will leave a comment here in case anyone faces the same problem:

I went into C:\Program Files\Python312\Lib\site-packages\ttkbootstrap and opened the file named widgets.py. I searched for the word CUBIC and replaced it with BICUBIC and saved it. That resolved the issue and TTK Creator starts without a problem.

Please note that the folder title Python312 might have different numbers on your computer depending on the version of Python installed.