I moved this morning from 4.1.0 to 4.1.1 and discovered the error (in /var/log/syslog):
Module 'user.xstats' has no attribute 'XStatsService' when searching ...
In fact it was already there in 4.1.0, but I didn't noticed, as it had no apparent effects.
I tries to figure out what/where is wrong, but no success. Then I found you answer, implemented it and the result is catastrophic. Weewx stops working.
Running "wee_extension --uninstall " is not better. (Error: No module named 'user.xstats', seems normal, but I don;t know where to go.
May be I should better reinstall weewx.
Running python 3, on a Debian 10.4 X64 / DEBUG is ON.
**** Module 'user.xstats' has no attribute 'XStatsService' when searching for 'user.xstats.XStatsService'
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** Traceback (most recent call last):
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** File "/usr/share/weewx/weeutil/weeutil.py", line 1098, in get_object
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** mod = getattr(mod, part)
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** AttributeError: module 'user.xstats' has no attribute 'XStatsService'
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: ****
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** During handling of the above exception, another exception occurred:
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: ****
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** Traceback (most recent call last):
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** File "/usr/share/weewx/weewxd", line 148, in main
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** engine = weewx.engine.StdEngine(config_dict)
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** File "/usr/share/weewx/weewx/engine.py", line 75, in __init__
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** self.loadServices(config_dict)
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** File "/usr/share/weewx/weewx/engine.py", line 138, in loadServices
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** obj = weeutil.weeutil.get_object(svc)(self,config_dict)
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** File "/usr/share/weewx/weeutil/weeutil.py", line 1102, in get_object
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** "Module '%s' has no attribute '%s' when searching for '%s'" % (mod.__name__, part, module_class))
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** AttributeError: Module 'user.xstats' has no attribute 'XStatsService' when searching for 'user.xstats.XStatsService'
Jun 2 23:04:57 aragorn weewx[4012] CRITICAL __main__: **** Exiting.
Any help will be welcome, but no hurry! It is time to sleep form me...