Forecast Extension and Python 3

219 views
Skip to first unread message

Tony Deets

unread,
Jun 14, 2020, 10:41:50 PM6/14/20
to weewx-user
I recently move weewx form a Pi 3 running Stretch with weewx using Python 2.7 to a Pi 4 running Buster using Python 3.whatever.  The new Pi 4 weewx setup is almost exact copy of Pi 3 setup.  The one difference is that when the Forecast extension installed and enabled I get the following syslog error:

Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__: Caught unrecoverable exception:
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  '>' not supported between instances of 'float' and 'NoneType'
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 195, in run
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.CHECK_LOOP, packet=packet))
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      callback(event)
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 578, in check_loop
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      raise BreakLoop
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  weewx.engine.BreakLoop
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     **** 
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     **** 
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 154, in main
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      engine.run()
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 202, in run
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.POST_LOOP))
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      callback(event)
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 594, in post_loop
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      self._catchup(self.engine.console.genArchiveRecords)
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 643, in _catchup
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      origin='hardware'))
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      callback(event)
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****    File "/usr/share/weewx/user/forecast.py", line 1212, in update_forecast
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****      elif time.time() - self.interval > self.last_ts:
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  TypeError: '>' not supported between instances of 'float' and 'NoneType'
Jun 14 07:55:18 raspberrypi weewx[11874] CRITICAL __main__:     ****  Exiting.

When the Forecast extension is uninstalled the problem disappears and weewx executes without issue.  

I suspect that there might be a compatibility problem between the Forecast extension and Python 3.7 but have no direct evidence that that is the case. I am curious to know if any other users of the above are having this issue and is their a known workaround for this problem?  If not, I guess it will require taking a look at the source and seeing how badly I can muck things up...

p q

unread,
Jun 14, 2020, 11:28:48 PM6/14/20
to weewx...@googlegroups.com
There's a newer version with a fix. Search this group with the error message and you'll find it.

--
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/4feda774-b55a-4002-be2a-5a2358fa487do%40googlegroups.com.


--
Peter Quinn
(415)794-2264

Tony Deets

unread,
Jun 15, 2020, 8:18:05 PM6/15/20
to weewx-user
I thought I had the latest version of the Forecast extension but I only had the latest version from the project branch with a link in the weewx Forecast extension WIKI article.  Had forgotten about the other branch.

Thanks for pointing me to the a post with a link to the correct branch.

Arne Berglund

unread,
Jul 18, 2020, 9:15:17 PM7/18/20
to weewx-user
I've run into this with a server rebuild now as well, but I'm not finding a link to the other branch of the forecast extension. I've used this one:


But it is the one that fails. Can someone point me to the other branch please?

John Kline

unread,
Jul 18, 2020, 9:38:57 PM7/18/20
to weewx...@googlegroups.com

Let me know if you have any issues.

On Jul 18, 2020, at 6:15 PM, Arne Berglund <arne.a....@gmail.com> wrote:


I've run into this with a server rebuild now as well, but I'm not finding a link to the other branch of the forecast extension. I've used this one:


But it is the one that fails. Can someone point me to the other branch please?

--
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.

Arne Berglund

unread,
Jul 18, 2020, 10:18:22 PM7/18/20
to weewx-user
Thanks for that link. Unfortunately, it still gives an error.

Everything seems to work fine, until I add the search_list_extensions into skin.conf (using exfoliation 0.45).

When I add the third line here:

[CheetahGenerator]
    encoding
= html_entities
    search_list_extensions
= user.forecast.ForecastVariables

I get the following error in the log:

Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/exfoliation/index.html.tmpl
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_exfoliation_index_html_tmpl.py", line 1092, in respond
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'

Have I done something boneheaded?

John Kline

unread,
Jul 18, 2020, 10:26:48 PM7/18/20
to weewx...@googlegroups.com
Do you see the forecast reports?

Where did you get exfoliation 0.45?
Is it WeeWX 4 compatible?  If it is, I’ll give it a try.

On Jul 18, 2020, at 7:18 PM, Arne Berglund <arne.a....@gmail.com> wrote:


--
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.

John Kline

unread,
Jul 18, 2020, 10:40:36 PM7/18/20
to weewx...@googlegroups.com
I found it.

I get errors without adding ForecastVariables.  I’ll have a quick further look.

Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/exfoliation/index.html.tmpl                         
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'str' and 'int'                          
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):                                                     
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 321, in generate              
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()                                       
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 1292, in respond       
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 497, in __errorCatcher43                                                                                                                                                                         
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>                                                 
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 187, in get_windspeed_trend                                                                                                                                                                      
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'str' and 'int'                      
Jul 18 19:34:07 judygirldog wee_reports[18730] INFO weewx.cheetahgenerator: Generated 8 files for report exfoliation in 3.22 seconds                                      
Jul 18 19:34:19 judygirldog wee_reports[18730] INFO weewx.imagegenerator: Generated 68 images for report exfoliation in 11.41 seconds                                     
Jul 18 19:34:19 judygirldog wee_reports[18730] INFO weewx.reportengine: Copied 92 files to /home/weewx/public_html/exfoliation                                            



On Jul 18, 2020, at 7:26 PM, John Kline <jo...@johnkline.com> wrote:



Arne Berglund

unread,
Jul 18, 2020, 11:16:26 PM7/18/20
to weewx-user
Thanks for checking, John. I'd like to have forecasting, but really don't want to have to find and tweak a new skin.


On Saturday, July 18, 2020 at 7:40:36 PM UTC-7, John Kline wrote:
I found it.

I get errors without adding ForecastVariables.  I’ll have a quick further look.

Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/exfoliation/index.html.tmpl                         
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'str' and 'int'                          
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):                                                     
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 321, in generate              
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()                                       
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 1292, in respond       
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 497, in __errorCatcher43                                                                                                                                                                         
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>                                                 
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 187, in get_windspeed_trend                                                                                                                                                                      
Jul 18 19:34:05 judygirldog wee_reports[18730] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'str' and 'int'                      
Jul 18 19:34:07 judygirldog wee_reports[18730] INFO weewx.cheetahgenerator: Generated 8 files for report exfoliation in 3.22 seconds                                      
Jul 18 19:34:19 judygirldog wee_reports[18730] INFO weewx.imagegenerator: Generated 68 images for report exfoliation in 11.41 seconds                                     
Jul 18 19:34:19 judygirldog wee_reports[18730] INFO weewx.reportengine: Copied 92 files to /home/weewx/public_html/exfoliation                                            



On Jul 18, 2020, at 7:26 PM, John Kline <jo...@johnkline.com> wrote:


Do you see the forecast reports?

Where did you get exfoliation 0.45?
Is it WeeWX 4 compatible?  If it is, I’ll give it a try.

On Jul 18, 2020, at 7:18 PM, Arne Berglund <arne.a...@gmail.com> wrote:


Thanks for that link. Unfortunately, it still gives an error.

Everything seems to work fine, until I add the search_list_extensions into skin.conf (using exfoliation 0.45).

When I add the third line here:

[CheetahGenerator]
    encoding
= html_entities
    search_list_extensions
= user.forecast.ForecastVariables

I get the following error in the log:

Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/exfoliation/index.html.tmpl
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_exfoliation_index_html_tmpl.py", line 1092, in respond
Jul 18 19:11:18 localhost journal[14057]: weewx[14057] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'

Have I done something boneheaded?

--
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...@googlegroups.com.

John Kline

unread,
Jul 18, 2020, 11:40:58 PM7/18/20
to weewx...@googlegroups.com
I got it working.  There were no changes to forecasting.

exfoliation was not updated for WeeWX4/Py3.
You are welcome to give it a try:
If you are not up for it, that’s fine too.

On Jul 18, 2020, at 8:16 PM, Arne Berglund <arne.a....@gmail.com> wrote:


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/cbf64ac7-7657-48af-aad5-8e295821ac0fo%40googlegroups.com.

Arne Berglund

unread,
Jul 19, 2020, 1:32:03 AM7/19/20
to weewx-user
Happy to try it. Works fine, until I take the final step to add the ForecastVariables to the CheetahGenerator block. As soon as I do that it starts skipping index.html.tmpl with the errors posted above. Still complaining about a type error.

FWIW, the server is the latest update of CentOS 8, with Python 3.6.8. I'm using MySQL, not SQLite.


On Saturday, July 18, 2020 at 8:40:58 PM UTC-7, John Kline wrote:
I got it working.  There were no changes to forecasting.

exfoliation was not updated for WeeWX4/Py3.
You are welcome to give it a try:
If you are not up for it, that’s fine too.

John Kline

unread,
Jul 19, 2020, 9:51:23 AM7/19/20
to weewx...@googlegroups.com
Hi Arne,

When you add the ForecastVariables, you are causing more exfoliation skin template code to execute, and that code has issues when running under Python3.

Unfortunately, I am unable to reproduce your issue.  With the changes I made to exfoliation, I am able to view forecasts in exfoliation with no issue (BTW, not WU as that no longer works with forecast.)

I’m assuming you did remember to install my updated exfoliation skin.  As such, it is likely a different path you are taking through the exfoliation code due to a different configuration.  If you want, please send any files you have changed in exfoliation.  With those changes, perhaps I can duplicate your errors.  BTW, it would probably be good to send those errors again, just in case they aren’t exactly the same ones as before.

On Jul 18, 2020, at 10:32 PM, Arne Berglund <arne.a....@gmail.com> wrote:


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/a6cc0958-b893-4304-af7f-bf1057f5d185o%40googlegroups.com.

Arne Berglund

unread,
Jul 19, 2020, 1:07:29 PM7/19/20
to weewx-user
OK, with that as my hint, I discovered that uninstalling a skin does not remove all the files for that skin. So when installing a new version of the skin, some old files remain. So I did the following:

Uninstalled the old exfoliation version.
Restarted weewx service.
Renamed the remaining exfoliation directories in both /etc/weewx/skins and /var/www/html/weewx
Installed the updated version that you de-bugged
Restarted weewx service.

After then configuring the forecast bits and adding the variables as before, everything now works.

I can now slowly migrate my skin customizations back in a bit at a time, watching for new errors. Should be pretty straightforward at this point.

Thanks for your assistance!!

John Kline

unread,
Jul 19, 2020, 4:00:47 PM7/19/20
to weewx...@googlegroups.com
Wow!  I was not expecting that reply.

I’m glad it is working for you.


On Jul 19, 2020, at 10:07 AM, Arne Berglund <arne.a....@gmail.com> wrote:


--
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.
Reply all
Reply to author
Forward
0 new messages