re: "AttributeError: tuype object 'ImageDraw' has no attribute 'textsize'"

9,531 views
Skip to first unread message

Sam Finn

unread,
Jul 2, 2023, 5:30:39 PM7/2/23
to weewx-user
Hi - 

I'm hoping someone can help me get my weewx install working again.

Some time ago (last April) weewx stopped updating my web page. [Many things have been going on and I am only now and able to get to this.] There might have been a Mac OS update at that time; however, I simply don't know. The weewx.log file is showing the error message "AttributeError: tuype object 'ImageDraw' has no attribute 'textsize'".

I've updated my weewx installation to 4.9.1 and am using the vanilla weewx.conf file with the minimum system (Vantage) configuration: i.e., no special skins, etc. The weewx.log file shows the same error.

To my untrained eye I've checked that my python3 installation is complete, at least as far as packages specified in the docs go.

Attached are
* the section of the weewx.log file for the most recent weewx run;
* the [Station] section of the weewx.conf file

I'm running Vantage Vue h/w (2018) with an old-style weatherlink console connected to my desktop over ethernet via a Davis datalogger (also 2018 vintage).

Thanks much for any help/guidance.




weewx.log
weewx.conf

Tom Keffer

unread,
Jul 2, 2023, 6:10:30 PM7/2/23
to weewx...@googlegroups.com
This is a known problem caused by a change in Pillow, the imaging library used by WeeWX.

If you're on a Mac, you probably installed Pillow using pip. See what version of Pillow you have by using these two methods.

python3 -m pip list -v

python3 -c "import PIL;print(PIL.__version__)"


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

python3 -m pip install Pillow==9.5.0

If it's earlier than 10.0, then it's some other problem.

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/704f5d10-8c3a-4727-85bb-ec3e616aeba5n%40googlegroups.com.

Sam Finn

unread,
Jul 2, 2023, 7:39:44 PM7/2/23
to weewx-user
Hi Tom - 

Thanks much! I was running w/Pillow 10.0. I backed-off to 9.5.0 but am not getting a different error: 

weewx sudo bin/wee_reports weewx.conf

Generating as of last timestamp in the database.

Using configuration file weewx.conf

Traceback (most recent call last):

  File "/Users/Shared/weewx/bin/weewx/reportengine.py", line 197, in run

    obj.start()

  File "/Users/Shared/weewx/bin/weewx/reportengine.py", line 385, in start

    self.run()

  File "/Users/Shared/weewx/bin/weewx/imagegenerator.py", line 42, in run

    self.gen_images(self.gen_ts)

  File "/Users/Shared/weewx/bin/weewx/imagegenerator.py", line 114, in gen_images

    image = plot.render()

  File "/Users/Shared/weewx/bin/weeplot/genplot.py", line 222, in render

    self._renderDayNight(sdraw)

  File "/Users/Shared/weewx/bin/weeplot/genplot.py", line 266, in _renderDayNight

    sdraw.rectangle(((xleft,self.yscale[0]),

  File "/Users/Shared/weewx/bin/weeplot/utilities.py", line 442, in rectangle

    self.draw.rectangle(box_scaled, **options)

  File "/Library/Python/3.9/site-packages/PIL/ImageDraw.py", line 294, in rectangle

    self.draw.draw_rectangle(xy, fill, 1)

ValueError: y1 must be greater than or equal to y0


Are there further suggestions? 

Again, thanks!

Sam

Tom Keffer

unread,
Jul 2, 2023, 7:50:12 PM7/2/23
to weewx...@googlegroups.com
Oops. Foiled by Issue #862!

Try an even earlier version of Pillow. Say, 9.4.0.

-tk

Sam Finn

unread,
Jul 2, 2023, 8:03:46 PM7/2/23
to weewx-user
Thanks again. Backing-off to 9.4.0, and using the modified sqlite.py to take care of the missing RADIAN function, has apparently done the trick!

Best - 

Sam

Andrea

unread,
Jul 13, 2023, 4:10:01 PM7/13/23
to weewx-user
Hi
I received the same error. Suddenly I got this error.. while running !
I'm using weewx 4.7.0 with  Linux Manjaro.
Can you help me to solve this errror?
thanks
Andrea

Tom Keffer

unread,
Jul 13, 2023, 5:02:43 PM7/13/23
to weewx...@googlegroups.com
Look farther upthread for the solution.

Andrea

unread,
Jul 14, 2023, 2:09:08 AM7/14/23
to weewx-user
I've already tried this trick but with no succes.
Thanks
Andrea

Andrea

unread,
Jul 14, 2023, 6:36:49 AM7/14/23
to weewx-user

I solved installing the new version of genplot.py from weewx files that are in the developing directory.
Some software changes and now is up and running again!

Andrea
Message has been deleted

vince

unread,
Sep 30, 2023, 4:25:09 PM9/30/23
to weewx-user
https://raw.githubusercontent.com/weewx/weewx/V5/bin/weeplot/genplot.py for the latest v5 version

On Saturday, September 30, 2023 at 1:22:51 PM UTC-7 kd4e wrote:
I'm just setting up WeeWx on an inovato Quadra with an Acu-Rite weather station (label says Model 01536
 but lsusb says Chaney Instrument Model 01036 weather sensor).

Anyhow, I'm getting looped data and no chart or graph.

Where would I find the development version of genplot.py - I don't seem to be able to locate it in the installed files.

Thanks!
Message has been deleted
Message has been deleted

Tom Keffer

unread,
Sep 30, 2023, 5:47:03 PM9/30/23
to weewx...@googlegroups.com
kd4e, I'm not sure why you put your post under this thread. Are you getting this error? If so, the current version of WeeWX, v4.10.2, as well as the beta version of v5.0, have the fix. 

If this is not your problem, you should really start a new thread.

I'm not sure why you need genplot.py, but you will find it at /usr/share/weewx/weeplot/genplot.py.

On Sat, Sep 30, 2023 at 1:55 PM kd4e <kd4e...@gmail.com> wrote:
Cool, thanks! Should a file like that have been auto-generated during install or setup? I don't find one. There is a weeplot in /usr/share/weewx
Reply all
Reply to author
Forward
Message has been deleted
0 new messages