报错问题: 

w, h = self.font.getsize(label)  # text width, height AttributeError: 'FreeTypeFont' object has no attribute 'getsize'

解决方法一: 

 修改代码

w, h = self.font.getsize(label) # text width, height

改为:

unused1,unused2,w, h = self.font.getbbox(label)  # text width, height

解决方法二:

降级pillow版本

pip install Pillow==9.5.0 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐