weewx 4.3.0 uses Python 2.7 instead of Python 3

68 views
Skip to first unread message

Rene

unread,
Jan 20, 2021, 6:56:27 AM1/20/21
to weewx-user
Hi all,
I'm running weewx 4.3.0 and it still uses Python 2.7 although I have installed Python 3 and /usr/bin/weewxd contains:

#!/bin/sh
app=weewxd

# Get the weewx location and interpreter.  Default to something sane, but
# look for overrides from the system defaults.
WEEWX_BINDIR=/home/weewx/bin
WEEWX_PYTHON=python3
[ -r /etc/default/weewx ] && . /etc/default/weewx
$WEEWX_PYTHON $WEEWX_BINDIR/$app $*

From syslog:

Jan 20 12:47:42 brix systemd[1]: Starting weewx weather system...
Jan 20 12:47:42 brix weewx[26249] INFO __main__: Initializing weewx version 4.3.0
Jan 20 12:47:42 brix weewx[26249] INFO __main__: Using Python 2.7.17 (default, Sep 30 2020, 13:38:04) #012[GCC 7.5.0]
Jan 20 12:47:42 brix weewx[26249] INFO __main__: Platform Linux-4.15.0-130-generic-x86_64-with-Ubuntu-18.04-bionic
Jan 20 12:47:42 brix weewx[26249] INFO __main__: Locale is 'de_DE.UTF-8'
Jan 20 12:47:42 brix weewx[26249] INFO __main__: PID file is /var/run/weewx.pid
Jan 20 12:47:42 brix weewx[26257] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Jan 20 12:47:42 brix weewx[26257] INFO __main__: Debug is 0

I was looking into the logs because on January 5th weewx stopped generating reports. It runs fine otherwise, uploads data to WU and sends data with MQTT but no more reports. I think it was the day when I upgraded weewx from 4.2.0 to 4.3.0 and wanted to try now if Python 3 fixes the issue. There are no errors from weewx in the log.

Rene

unread,
Jan 20, 2021, 6:59:23 AM1/20/21
to weewx-user
Just to add that Python 3 works:

root@brix:~# python3 --version
Python 3.6.9

Tom Keffer

unread,
Jan 20, 2021, 7:26:48 AM1/20/21
to weewx-user
The file /etc/default/weewx controls which version of Python to use. Look in there.

However, it will not work unless the Python 3 prerequisites have been installed. If they have not, then you are better off following the instructions in the WeeWX Debian guide:

wget -qO - https://weewx.com/apt/weewx-python3.list | sudo tee /etc/apt/sources.list.d/weewx.list
sudo apt-get update
sudo apt-get install weewx



--
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 on the web visit https://groups.google.com/d/msgid/weewx-user/8982f04c-da2d-4c3f-9686-f06bde9fe16an%40googlegroups.com.

Rene

unread,
Jan 20, 2021, 11:14:24 AM1/20/21
to weewx-user
Thank you very much, the pointer to /etc/default/weewx was the solution. I changed the entry from python2 to python3. This then revealed after a restart of weewx an error within the forecast extension which led me to update the extension which removed the error and finally reports are generated again (plus weewx now runs on a current version of python).
Reply all
Reply to author
Forward
0 new messages