Error upgrading to 5.2

115 views
Skip to first unread message

Rob Cranfill

unread,
Oct 14, 2025, 8:36:43 PM (2 days ago) Oct 14
to weewx-user
Trying to go from 5.0.2 (I think) to 5.2, I get the following in my log (see below). Suggestions?

System: 
  rob@pi4:/etc/weewx $ lsb_release -a
  No LSB modules are available.
  Distributor ID: Debian
  Description:    Debian GNU/Linux 12 (bookworm)
  Release:        12
  Codename:       bookworm

Been working fine for over a year with 5.0.2. :-]



Oct 14 17:08:55 pi4 systemd[1]: Started weewx.service - WeeWX.
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Initializing weewxd version 5.2.0
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Using Python: 3.13.1 (main, Dec 12 2024, 15:48:42) [GCC 12.2.0]
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Located at:   /usr/local/bin/python3
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Platform:     Linux-6.12.34+rpt-rpi-v8-aarch64-with-glibc2.36
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Locale:       'en_US.UTF-8'
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Entry path:   /usr/share/weewx/weewxd.py
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: WEEWX_ROOT:   /etc/weewx
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Config file:  /etc/weewx/weewx.conf
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: User module:  /etc/weewx/bin/user
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Debug:        0
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: User:         weewx
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Group:        weewx
Oct 14 17:08:56 pi4 weewxd[3538]: INFO __main__: Groups:       dialout www-data weewx
Oct 14 17:08:56 pi4 weewxd[3538]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Oct 14 17:08:56 pi4 weewxd[3538]: ERROR weewx.engine: Import of driver failed: No module named 'serial' (<class 'ModuleNotFoundError'>)
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in setupStation
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****                     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 32, in loader
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 2046, in __init__
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 536, in __init__
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      self.port.openPort()
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      ~~~~~~~~~~~~~~~~~~^^
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 317, in openPort
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****      import serial
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****  ModuleNotFoundError: No module named 'serial'
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL __main__: Unable to load driver: No module named 'serial'
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL __main__:     ****  Exiting...
Oct 14 17:08:56 pi4 systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 14 17:08:56 pi4 systemd[1]: weewx.service: Failed with result 'exit-code'.


Seems like the error is 

Oct 14 17:08:56 pi4 weewxd[3538]: ERROR weewx.engine: Import of driver failed: No module named 'serial' (<class 'ModuleNotFoundError'>)

But I do think pyserial is installed:

rob@pi4:/etc/weewx $ pip install pyserial
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyserial in /home/rob/.local/lib/python3.13/site-packages (3.5)

Message has been deleted

Rob Cranfill

unread,
Oct 14, 2025, 8:39:06 PM (2 days ago) Oct 14
to weewx-user
I should have mentioned I have been installing/upgrading via the "configure apt" method - not a .deb file, as detailed at https://weewx.com/docs/5.2/quickstarts/debian/.
 /r

John Smith

unread,
Oct 14, 2025, 8:55:21 PM (2 days ago) Oct 14
to weewx...@googlegroups.com
apt is still using a .deb file, but it looks like your missing the python serial module...

apt install python3-serial

On Wed, 15 Oct 2025 at 11:38, Rob Cranfill <robcr...@gmail.com> wrote:
I should have mentioned I have been installing/upgrading via the "install via apt" method - not a .deb file.
 /r

--
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 visit https://groups.google.com/d/msgid/weewx-user/17eb45e4-e922-410f-9137-b2250149a344n%40googlegroups.com.

Rob Cranfill

unread,
Oct 14, 2025, 8:59:51 PM (2 days ago) Oct 14
to weewx-user
And my station is a Vangage VUE; the config section for that is, as it was before,

[Vantage]
    # This section is for the Davis Vantage series of weather stations.
   
    # Connection type: serial or ethernet
    #  serial (the classic VantagePro)
    #  ethernet (the WeatherLinkIP or Serial-Ethernet bridge)
    type = serial
   
    # If the connection type is serial, a port must be specified:
    #   Debian, Ubuntu, Redhat, Fedora, and SuSE:
    #     /dev/ttyUSB0 is a common USB port name
    #     /dev/ttyS0   is a common serial port name
    #   BSD:
    #     /dev/cuaU0   is a common serial port name
    port = /dev/ttyUSB0
    


Rob Cranfill

unread,
Oct 14, 2025, 9:09:29 PM (2 days ago) Oct 14
to weewx-user
FYI, when I get "info", I see good stuff. So weewx can talk to the device OK. :-/

rob@pi4:/etc/weewx $ weectl device weewx.conf --info
Using configuration file weewx.conf
Using driver weewx.drivers.vantage.
Using Vantage driver version 3.6.3 (weewx.drivers.vantage)
Querying...
Davis Vantage EEPROM settings:
   
    CONSOLE TYPE:                   Vantage Vue
   
    CONSOLE FIRMWARE:
      Date:                         Feb  3 2015
      Version:                      4.18
   
    CONSOLE SETTINGS:
      Archive interval:             300 (seconds)
      Altitude:                     150 (foot)
      Wind cup type:                large
      Rain bucket type:             0.01 inches
      Rain year start:              1
      Onboard time:                 2025-10-14 18:08:22
     
    CONSOLE DISPLAY UNITS:
      Barometer:                    mbar
      Temperature:                  degree_F
      Rain:                         inch
      Wind:                         mile_per_hour
     
    CONSOLE STATION INFO:
      Latitude (onboard):           +47.6
      Longitude (onboard):          -122.3
      Use manual or auto DST?       AUTO
      DST setting:                  N/A
      Use GMT offset or zone code?  ZONE_CODE
      Time zone code:               4
      GMT offset:                   N/A
      Temperature logging:          LAST
       
    TRANSMITTERS:
      Channel   Receive   Retransmit  Repeater    Type
         1      active        N         NONE      iss
         2      inactive      N         NONE      (N/A)
         3      inactive      N         NONE      (N/A)
         4      inactive      N         NONE      (N/A)
         5      inactive      N         NONE      (N/A)
         6      inactive      N         NONE      (N/A)
         7      inactive      N         NONE      (N/A)
         8      inactive      N         NONE      (N/A)

    RECEPTION STATS:
      Total packets received:       9832
      Total packets missed:         15605
      Number of resynchronizations: 1
      Longest good stretch:         8
      Number of CRC errors:         5459
     
    BAROMETER CALIBRATION DATA:
      Current barometer reading:    30.032 inHg
      Altitude:                     150 feet
      Dew point:                    42 F
      Virtual temperature:          49 F
      Humidity correction factor:   1.8
      Correction ratio:             1.006
      Correction constant:          +0.000 inHg
      Gain:                         0.000
      Offset:                       -33.000
     
    OFFSETS:
      Wind direction:               +0 deg
      Inside Temperature:           +0.0 F
      Inside Humidity:              +0 %
      Outside Temperature:          +0.0 F
      Outside Humidity:             +0 %

Rob Cranfill

unread,
Oct 14, 2025, 9:10:42 PM (2 days ago) Oct 14
to weewx-user
I think it's installed:

rob@pi4:/etc/weewx $ sudo apt install python3-serial
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-serial is already the newest version (3.5-1.1).


John Smith

unread,
Oct 14, 2025, 9:19:23 PM (2 days ago) Oct 14
to weewx...@googlegroups.com
I'm not sure why weeWX can't find it then, but your initial post says it can't find it... Did you also upgrade to Trixie or something?

Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL weewx.engine:     ****  ModuleNotFoundError: No module named 'serial'
Oct 14 17:08:56 pi4 weewxd[3538]: CRITICAL __main__: Unable to load driver: No module named 'serial'

Rob Cranfill

unread,
Oct 15, 2025, 12:21:07 PM (20 hours ago) Oct 15
to weewx-user
No, still using Debian bookworm.

On Tuesday, October 14, 2025 at 6:19:23 PM UTC-7 John Smith wrote:
I'm not sure why weeWX can't find it then, but your initial post says it can't find it... Did you also upgrade to Trixie or something?

Rob Cranfill

unread,
Oct 15, 2025, 12:46:10 PM (20 hours ago) Oct 15
to weewx-user
All,

I'm reading the docs and trying the various debugging guides, and just got some good/different results by running weewxd in the foreground. A new error has popped up, perhaps a clue to what-all is going on.

One line of data collection shown, then two Python errors: importing Cheetah and PIL. Should I try installing these by hand? (I'll ignore the question of why they weren't already installed, either from my 5.0.2 weewx, or by the new installer.) 

...
93530461563, rain: 0.0, rainAlarm: 0.0, rainRate: 0.0, rxCheckPercent: 37.58333333333333, soilLeafAlarm1: 0.0, soilLeafAlarm2: 0.0, soilLeafAlarm3: 0.0, soilLeafAlarm4: 0.0, stormRain: 0.0, sunrise: 1760538540.0, sunset: 1760577600.0, txBatteryStatus: 0, usUnits: 1, wind_samples: 44.0, windchill: 46.1, windDir: None, windGust: 1.0, windGustDir: 0.0, windrun: 0.0, windSpeed: 0.0, windSpeed10: 0.0, yearET: 0.0, yearRain: 17.96

Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 231, in run
    obj = weeutil.weeutil.get_object(generator)(
          ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/share/weewx/weeutil/weeutil.py", line 1404, in get_object
    module = importlib.import_module(module_name)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 67, in <module>
    import Cheetah.Filters
ModuleNotFoundError: No module named 'Cheetah'

Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 231, in run
    obj = weeutil.weeutil.get_object(generator)(
          ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/share/weewx/weeutil/weeutil.py", line 1404, in get_object
    module = importlib.import_module(module_name)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/share/weewx/weewx/imagegenerator.py", line 14, in <module>
    import weeplot.genplot
  File "/usr/share/weewx/weeplot/genplot.py", line 13, in <module>
    from PIL import Image, ImageDraw, ImageFont
ModuleNotFoundError: No module named 'PIL'

Followed by the same Cheetah error again.

Suggestions?

Rob Cranfill

unread,
Oct 15, 2025, 12:47:42 PM (19 hours ago) Oct 15
to weewx-user
Oh, and

rob@pi4:~ $ python3
Python 3.13.1 (main, Dec 12 2024, 15:48:42) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> import PIL

Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    import PIL

ModuleNotFoundError: No module named 'PIL'
>>> import Cheetah

Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    import Cheetah

ModuleNotFoundError: No module named 'Cheetah'

vince

unread,
Oct 15, 2025, 3:19:49 PM (17 hours ago) Oct 15
to weewx-user
You have some kind of non-standard legacy python installation.  Notice the path to python below ?

Oct 14 17:08:55 pi4 systemd[1]: Started weewx.service - WeeWX.
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Initializing weewxd version 5.2.0
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Using Python: 3.13.1 (main, Dec 12 2024, 15:48:42) [GCC 12.2.0]
Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Located at:   /usr/local/bin/python3

I suspect if you used /usr/bin/python3 it would work.

Rob Cranfill

unread,
Oct 15, 2025, 7:35:20 PM (13 hours ago) Oct 15
to weewx-user
On Wednesday, October 15, 2025 at 12:19:49 PM UTC-7 vince wrote:
You have some kind of non-standard legacy python installation.  Notice the path to python below ?

..

Oct 14 17:08:55 pi4 weewxd[3538]: INFO __main__: Located at:   /usr/local/bin/python3

I suspect if you used /usr/bin/python3 it would work.


Yes! That's got to be it. But I'm having trouble getting WeeWX to use the Python I want.

I start it with this service file:

rob@pi4:/etc/weewx $ cat /lib/systemd/system/weewx.service
# systemd service configuration file for WeeWX

# fixed after upgrade to WeeWX 5.2?
# using /usr/share/weewx/weewxd.py

[Unit]
Description=WeeWX
Documentation=https://weewx.com/docs
Requires=time-sync.target
After=time-sync.target
Wants=network-online.target
After=network-online.target

[Service]
# was: ExecStart=weewxd /etc/weewx/weewx.conf
ExecStart=/usr/bin/python3.11 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
StandardOutput=null
StandardError=journal+console
RuntimeDirectory=weewx
RuntimeDirectoryMode=775
User=weewx
Group=weewx

[Install]
WantedBy=multi-user.target
 

wherein I specify the path to Python3.11 But in the logs, nothing has changed:

Oct 15 16:28:55 pi4 systemd[1]: Started weewx.service - WeeWX.
Oct 15 16:28:56 pi4 weewxd[615557]: INFO __main__: Initializing weewxd version 5.2.0
Oct 15 16:28:56 pi4 weewxd[615557]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Oct 15 16:28:56 pi4 weewxd[615557]: INFO __main__: Using Python: 3.13.1 (main, Dec 12 2024, 15:48:42) [GCC 12.2.0]
Oct 15 16:28:56 pi4 weewxd[615557]: INFO __main__: Located at:   /usr/local/bin/python3


If I use that ExecStart (/usr/bin/python3.11 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf) from the command line, it works fine.

Thoughts? I'll go read the "starting weewx" docs again.....


Rob Cranfill

unread,
Oct 15, 2025, 7:40:49 PM (13 hours ago) Oct 15
to weewx-user
Oh, and I modified weewxd.py thusly:

rob@pi4:/etc/weewx $ cat /usr/bin/weewxd
#!/bin/sh
app=weewxd.py

# Get the weewx location and interpreter.  Default to something sane, but
# look for overrides from the system defaults.
WEEWX_BINDIR=/usr/share/weewx
WEEWX_PYTHON=/usr/bin/python3.11
[ -r /etc/default/weewx ] && . /etc/default/weewx
exec "$WEEWX_PYTHON" $WEEWX_PYTHON_ARGS "$WEEWX_BINDIR/$app" "$@"

Rob Cranfill

unread,
Oct 15, 2025, 7:44:45 PM (13 hours ago) Oct 15
to weewx-user

Fixed!

I forgot to do systemctl daemon-reload !

Thanks, everyone!! 

  See my output at http://robcranfill.net/weather (for the Seasons skin) or http://robcranfill.net/weather/Crandard for my nice 20-foot GUI. :-)
Reply all
Reply to author
Forward
0 new messages