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




On Friday, 8 May 2020 16:44:38 UTC+10, J Stargazer wrote:
>
> 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.
>>
>> On Thursday, May 7, 2020 at 11:23:08 PM UTC-7, J Stargazer wrote:
>>>
>>> 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
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/64af53ff-0007-44d0-9dda-304b6422c021%40googlegroups.com.

Reply via email to