Daveiano / weewx-wdc

Weather Data Center skin for WeeWX
https://www.weewx-hbt.de/
GNU General Public License v3.0
48 stars 14 forks source link

No module named 'user.forecast' #29

Closed guidocioni closed 2 years ago

guidocioni commented 2 years ago

First of all, nice work! Really nice looking skin :)

Followed the installation instructions but got this issue

Jul 12 18:12:51 weather weewx[1758] DEBUG weewx.cheetahgenerator: Using search list ['user.general_util.GeneralUtil', 'user.stats_util.StatsUtil', 'user.diagram_util.DiagramUtil', 'user.celestial_util.CelestialUtil', 'user.archive_util.ArchiveUtil', 'user.table_util.TableUtil', 'user.forecast_util.ForecastUtil', 'weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.DisplayOptions', 'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.Gettext', 'weewx.cheetahgenerator.JSONHelpers', 'weewx.cheetahgenerator.PlotInfo', 'weewx.cheetahgenerator.SkinInfo', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo']
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****  No module named 'user.forecast'
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      obj.start()
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      self.run()
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      self.init_extensions(gen_dict[section_name])
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 197, in init_extensions
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      klass = weeutil.weeutil.get_object(x)
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1150, in get_object
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      mod = __import__(module)
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/user/forecast_util.py", line 2, in <module>
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****      from user.forecast import ForecastVariables
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****  ModuleNotFoundError: No module named 'user.forecast'
Jul 12 18:12:51 weather weewx[1758] ERROR weewx.reportengine:         ****  Generator terminated

I resolved by removing the part about forecast generation, i.e. 'user.forecast_util.ForecastUtil', and it is working. However, I think this is unexpected behaviour due to some mistake in the installation. Do you have any idea what the issue is?

Daveiano commented 2 years ago

Thank you for the kind words!

Yes, this is a bug. The default skin.conf and the readme are currently wrong.

user.forecast.ForecastVariables AND user.forecast_util.ForecastUtil should only be added as search_list_extensions if weewx-forecast is installed. Otherwise, weewx will throw the error you described.

Thank you for catching this and opening an issue! I will push a fix by the end of the week.

guidocioni commented 2 years ago

Glad to be of some help :)

Daveiano commented 2 years ago

Ok, I updated the readme and released v1.3.2 with an updated skin.conf. This should solve the issue, thanks again for reporting!

https://github.com/Daveiano/weewx-wdc/releases/tag/v1.3.2