Issue with weewx-meteotemplate after upgradeing weewx v4

111 views
Skip to first unread message

J Stargazer

unread,
May 8, 2020, 2:23:08 AM5/8/20
to weewx-user
Hi all.

I'm having a bit of an issue with installing the weewx-meteotemplate extension.
I had few other issues as well, but have resolved most of those by uninstalling the extensions and reinstalling them.

The error I am getting is;

May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__: Caught unrecoverable exception:
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****  invalid syntax (meteotemplate.py, line 106)
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****  Traceback (most recent call last):
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 148, in main
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 75, in __init__
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****      self.loadServices(config_dict)
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 138, in loadServices
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1093, in get_object
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****      mod = __import__(module)
May  8 14:21:01 jupiter weewx[2718] CRITICAL __main__:     ****    File "/usr/share/weewx/user/meteotemplate.py", line 106
May  8 14:21:02 jupiter weewx[2718] CRITICAL __main__:     ****      except KeyError, e:
May  8 14:21:02 jupiter weewx[2718] CRITICAL __main__:     ****                     ^
May  8 14:21:02 jupiter weewx[2718] CRITICAL __main__:     ****  SyntaxError: invalid syntax
May  8 14:21:02 jupiter weewx[2718] CRITICAL __main__:     ****  Exiting.
May  8 14:21:35 jupiter weewx[2764]: Stopping weewx weather system: weewx not running....

I followed the error to - File "/usr/share/weewx/user/meteotemplate.py", line 106
Line 106 shows (highlighted yellow);

       super(Meteotemplate, self).__init__(engine, cfg_dict)       
        loginf("service version is %s" % VERSION)
        try:
            site_dict = cfg_dict['StdRESTful']['Meteotemplate']
            site_dict = accumulateLeaves(site_dict, max_level=1)
            site_dict['password']
        except KeyError, e:
            logerr("Data will not be uploaded: Missing option %s" % e)
            return

Unfortunately I have no idea what this is telling me.

Any help would be really appreciated.

Thanks,
Jono
Message has been deleted

J Stargazer

unread,
May 8, 2020, 2:44:38 AM5/8/20
to weewx-user
Thanks JD.
Unfortunately when I upgraded my system python was up dated to version 3.
And I'm no programmer convert the code is probably not going to work for me.

On Friday, May 8, 2020 at 6:29:26 PM UTC+12, J D wrote:
Hi,
Three choices run under Python 2.7 or find a python 3 version of the code or convert the code from python2 to python3.

Greg from Oz

unread,
May 8, 2020, 7:02:42 AM5/8/20
to weewx-user
I have had success converting other scripts using a program called 2to3 

sudo apt install 2to3

If you run sudo 2to3 -w meteotemplate.py it might just work and it will also create a .bak file

Tom

unread,
May 8, 2020, 7:19:09 AM5/8/20
to weewx...@googlegroups.com
I have the same issues.  Thanks to Google I was able to correct the "except KeyError, e:" error but then other error messages appeared.  I sent Matthew, the owner of the extension, an email earlier but have not heard back from him.

Tom 
--
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/e4cbb0f2-d650-4fe7-a9f7-21c77008780a%40googlegroups.com.

Tom Keffer

unread,
May 8, 2020, 7:52:35 AM5/8/20
to weewx-user
Matthew and I are working on converting all of the uploaders. I'm working on meteotemplate, and expect to have something later today.

Tom Keffer

unread,
May 8, 2020, 8:40:41 AM5/8/20
to weewx-user

Tom

unread,
May 8, 2020, 10:25:42 AM5/8/20
to weewx...@googlegroups.com
Thanks Tom.  Seems to be working fine under Python3 and version 4.

J Stargazer

unread,
May 11, 2020, 10:09:56 PM5/11/20
to weewx-user
Thanks Tom.

I have update the extension and it is working great now.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

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