Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'PIL.Image' has no attribute 'CUBIC' #492

Closed
yefan-abcdefg opened this issue Sep 26, 2023 · 8 comments
Closed

AttributeError: module 'PIL.Image' has no attribute 'CUBIC' #492

yefan-abcdefg opened this issue Sep 26, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@yefan-abcdefg
Copy link

yefan-abcdefg commented Sep 26, 2023

Desktop (please complete the following information):

Windows Anaconde3
ttkbootstrap Version [e.g. 1.10.1]
Python Version 3.8.16
pip Version 20.0.1
pillow Version 10.0.1

Describe the bug

When I copy the __main__.py to my test project and run whith pyinstaller --hidden-import=ttkbootstrap demo.py , it‘s show an error like this.

  File "ttkbootstrap/widgets.py", line 856, in _draw_meter
AttributeError: module 'PIL.Image' has no attribute 'CUBIC'

the Error code:

img.resize((self._metersize, self._metersize), Image.CUBIC)

I found Image.LANCZOS maybe worked.

Can anyone tell me the reason?
version mismatch?or just a bug?

I don't want to change widgets.py's code and want have a suitable envs or version.

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response

@yefan-abcdefg yefan-abcdefg added the bug Something isn't working label Sep 26, 2023
@yefan-abcdefg yefan-abcdefg changed the title enter title of bug here AttributeError: module 'PIL.Image' has no attribute 'CUBIC' Sep 26, 2023
@rdbende
Copy link

rdbende commented Sep 26, 2023

Please people, look at exsisting issues before opening a new one. There are a dozen of issues here already about the exact same problem.
Unfortunately it wasn't fixed, because @israel-dryer isn't very active, but you can look at solutions in other threads, for example in #480

@yefan-abcdefg
Copy link
Author

yefan-abcdefg commented Sep 28, 2023

Please people, look at exsisting issues before opening a new one. There are a dozen of issues here already about the exact same problem. Unfortunately it wasn't fixed, because @israel-dryer isn't very active, but you can look at solutions in other threads, for example in #480

Think you for reminding me. I'm try use my way, and it works.

I'm fixed it by changing From Image.CUBIC to Image.LANCZOS.

Maybe change to Image.BICUBIC is the best,but my method seen useful also.

@rdbende
Copy link

rdbende commented Nov 29, 2023

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

@huangstoner
Copy link

怎么这类问题还不解决,刚好想美化下tk,下了发现一堆类似的错误。2024年了5月份了,你们还不更新啊

@rdbende
Copy link

rdbende commented May 5, 2024

Until the Pypi package is updated you can download the package from here and install it manually.

@TXLingH
Copy link

TXLingH commented May 7, 2024

前面的@huangstoner,有问题第一时间不找自己问题跑过来抱怨牛魔那 前面已经说了作者本人并不是很活跃所以更新不及时还在这叫 不想用别用

@bopo
Copy link

bopo commented May 10, 2024

安装小于10的 pillow就可以了

pip install 'pillow<10'

@huangstoner
Copy link

@TXLingH 可能你是个大喇叭,看不懂原话不要过来就巴拉巴拉,难道大家不能提建议?你又不是作者装什么清高,真是大无语,我要用不用碍着你了。。。。头一次遇到5^2*10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants