WeeWX 4.1.0
Installed via. package manager
I figured I would try and get my station up and running with 4.1 and
python3 today, but ran into a problem. For some reason, the aqi extension
(https://github.com/jonathankoren/weewx-aqi) can't find the calculator
module if I switch /etc/default/weewx to use WEEWX_PYTHON=python3. Even
after installing the needed modules and fixing the purpleair plugin (simple
fixes, adding "as" to exceptions and adding parens to one print call) I get:
May 28 14:37:20 weather weewx[3267] INFO __main__: Initializing weewx
version 4.1.0
May 28 14:37:20 weather weewx[3267] INFO __main__: Using Python 3.5.3
(default, Sep 27 2018, 17:25:39) #012[GCC 6.3.0 20170516]
May 28 14:37:20 weather weewx[3267] INFO __main__: Platform
Linux-4.19.57-v7+-armv7l-with-debian-9.11
May 28 14:37:20 weather weewx[3267] INFO __main__: Locale is 'en_US.UTF-8'
May 28 14:37:20 weather weewx[3267] INFO __main__: PID file is
/var/run/weewx.pid
May 28 14:37:20 weather weewx[3271] INFO __main__: Using configuration file
/etc/weewx/weewx.conf
May 28 14:37:20 weather weewx[3271] INFO __main__: Debug is 0
May 28 14:37:20 weather weewx[3271] INFO weewx.engine: Loading station type
Vantage (weewx.drivers.vantage)
May 28 14:37:20 weather weewx[3254]: Starting weewx weather system: weewx.
May 28 14:37:20 weather weewx[3271] INFO weewx.engine: StdConvert target
unit is 0x1
May 28 14:37:20 weather weewx[3271] INFO weewx.wxservices: The following
values will be calculated: pressure=prefer_hardware,
altimeter=prefer_hardware, appTemp=prefer_hardware,
barometer=prefer_hardware, beaufort=prefer_hardware, cloudbase=software,
dewpoint=prefer_hardware, ET=prefer_hardware, heatindex=prefer_hardware,
humidex=prefer_hardware, inDewpoint=prefer_hardware, maxSolarRad=software,
rainRate=prefer_hardware, windchill=prefer_hardware, windrun=prefer_hardware
May 28 14:37:20 weather weewx[3271] INFO weewx.wxservices: The following
algorithms will be used for calculations: altimeter=aaASOS, maxSolarRad=RS
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: Caught unrecoverable
exception:
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** No module
named 'calculators'
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** Traceback
(most recent call last):
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** File
"/usr/share/weewx/weewxd", line 148, in main
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** engine
= weewx.engine.StdEngine(config_dict)
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** File
"/usr/share/weewx/weewx/engine.py", line 75, in __init__
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: ****
self.loadServices(config_dict)
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** File
"/usr/share/weewx/weewx/engine.py", line 138, in loadServices
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** obj =
weeutil.weeutil.get_object(svc)(self,config_dict)
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** File
"/usr/share/weewx/weeutil/weeutil.py", line 1093, in get_object
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** mod =
__import__(module)
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** File
"/usr/share/weewx/user/aqi/service.py", line 15, in <module>
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** import
calculators
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: ****
ImportError: No module named 'calculators'
May 28 14:37:21 weather weewx[3271] CRITICAL __main__: **** Exiting.
Any idea why it can't find that module? I see it
in /usr/share/weewx/user/aqi/calculators.py, and it imports correctly under
python2. Even reinstalling the aqi extension after making the switch to
python3 doesn't help. Is there something different in the way the module
path is set in python 3.x?
The module itself loads fine in both python2 and python3 if I manually
force the path:
> python2
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/usr/share/weewx/user/aqi')
>>> import calculators
>>> ^C
> python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/usr/share/weewx/user/aqi')
>>> import calculators
>>> ^C
--
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/10184694-9cfa-4612-997b-20b8ff7a0c84%40googlegroups.com.