AttributeError: ‘ImageDraw‘ object has no attribute ‘textsize‘ Fix Pillow library error: Solve the problem that ImageDraw object has no textsize attribute

question

AttributeError: 'ImageDraw' object has no attribute 'textsize'

solution

1. You can use pip to install Pillow
2. Check your Pillow version.

The command line is shown below

python
>> pip install PIL
>> print(PIL.__version__)

If it's 10.0, then that's the problem. The solution is to downgrade your copy:

pip install Pillow==9.5.0

If it's earlier than 10.0, there may be other issues.

If changing from 10.0 to 9.5 still doesn't work, try a version again, for example, 9.4.0.

pip install Pillow==9.4.0

Guess you like

Origin blog.csdn.net/ABV09876543210/article/details/134812506