python3

148 views
Skip to first unread message

Cat22

unread,
Apr 25, 2020, 3:56:21 AM4/25/20
to weewx-development
So, I am having issues running weewx because "Python 2.7 reached the end of its life on January 1st, 2020."
Are there any plans to update weewx to python3?
At the moment i am dead in the water with exit code 4 which I cant seem to decode, this just after a reboot.
Before the reboot everything was running.  I suspect the issue may be that old python stuff was removed.

gjr80

unread,
Apr 25, 2020, 4:10:32 AM4/25/20
to weewx-development
Hi,

> So, I am having issues running weewx because "Python 2.7 reached the end of its life on January 1st, 2020."

I find this hard to believe. WeeWX v4, which is still in beta, (but will be released real soon now) will be python 2 and 3 compatible. I would suggest you wait for WeeWX v4 to be released before upgrading. In the meantime let’s see if we can work what your problem is. Could you please post a debug log. These instructions will help - https://github.com/weewx/weewx/wiki/Help!-Posting-to-weewx-user.

Gary

Cat22

unread,
Apr 25, 2020, 4:23:55 AM4/25/20
to weewx-development
System is openSuse Tumbleweed
I tried an strace which just left me wondering.
configobj was missing and i got pip2 to install it with lots of warnings.
Now it seems pyserial is also gone.
(There doesnt seem (I couldnt find one for  itto be a version of python serial for version 2.7 only for python3)
I think this might help:

-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit weewx.service has entered the 'failed' state with result 'exit-code'.
Apr 25 01:02:49 erb2 weewx[5432]: engine: Initializing weewx version 3.9.2
Apr 25 01:02:49 erb2 weewx[5432]: engine: Using Python 2.7.17 (default, Oct 24 2019, 12:43:41) [GCC]
Apr 25 01:02:49 erb2 weewx[5432]: engine: Platform Linux-5.4.14-x86_64-with-glibc2.2.5
Apr 25 01:02:49 erb2 weewx[5432]: engine: Locale is 'en_US.UTF-8'
Apr 25 01:02:49 erb2 weewx[5432]: engine: Using configuration file /usr/local/bin/weewx/weewx.conf
Apr 25 01:02:49 erb2 weewx[5432]: engine: Debug is 1
Apr 25 01:02:49 erb2 weewx[5432]: engine: Initializing engine
Apr 25 01:02:49 erb2 weewx[5432]: engine: Loading station type Vantage (weewx.drivers.vantage)
Apr 25 01:02:49 erb2 weewx[5432]: vantage: Driver version is 3.1.1
Apr 25 01:02:49 erb2 weewx[5432]: engine: Import of driver failed: No module named serial (<type 'exceptions.ImportError'>)
Apr 25 01:02:49 erb2 weewx[5432]: engine: Unable to load driver: No module named serial
Apr 25 01:02:49 erb2 weewx[5432]:     ****  Exiting...
Apr 25 01:02:49 erb2 systemd[1]: weewx.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit weewx.service has entered the 'failed' state with result 'exit-code'.


gjr80

unread,
Apr 25, 2020, 4:45:39 AM4/25/20
to weewx-development
OK so a missing python serial package is the issue. Not an openSUSE user but when I look at tumbleweed it shows a python-pyserial package and a python3-pyserial package. You can’t install python-pyserial?

Gary

Cat22

unread,
Apr 25, 2020, 4:54:04 AM4/25/20
to weewx-development


On Saturday, April 25, 2020 at 1:45:39 AM UTC-7, gjr80 wrote:
OK so a missing python serial package is the issue. Not an openSUSE user but when I look at tumbleweed it shows a python-pyserial package and a python3-pyserial package. You can’t install python-pyserial?

Gary

Yeh, I tried that. It seems only python3-serial is available and it is already installed

zypper install python-pyserial
Loading repository data...
Reading installed packages...
Package 'python-pyserial' not found.
Resolving package dependencies...

Nothing to do.

gjr80

unread,
Apr 25, 2020, 5:06:15 AM4/25/20
to weewx-development
Interesting, https://software.opensuse.org/ says it does exist, though as I said I am not an openSUSE user. Might need an openSUSE user to help.

WeeWX v4 is pretty stable. If you are (were) running a plain vanilla WeeWX install you should not have too many problems running the beta. The only issue you may strike (other than more openSUSE idiosyncrasies) is if you are running any WeeWX add ons/extensions - there may be problems if they have not been ported to WeeWX v4/python3. This link may help - https://github.com/weewx/weewx/wiki/Beta-testing-Weewx-version-4. If you are git competent it is pretty easy to run the current WeeWX master branch from github.

Gary

Cat22

unread,
Apr 25, 2020, 5:16:49 AM4/25/20
to weewx-development
The only extension I am running is the Steel Series gauges.
Do you think that will work with v4?
I'm will to try it, I am git competent, no problem there, python is a bit confusing for me but I can follow it mostly, my forte is C
If weewx was written in C (not c++) I'd be more than happy to dive in and contribute
BTW: I want to thank you for trying to get me going.  I really suspect that opensuse removed something that was key on their more recent updates and when I rebooted,  **BAM!** things just rolled over and died. They have done it before and they never say a word of warning before doing it.
The last time this happened they moved /etc/services out of /etc and, well, you can imagine how that went over.

gjr80

unread,
Apr 25, 2020, 5:26:38 AM4/25/20
to weewx-development
SteelSeries will be fine, or if not an easy fix. I see b18 is the currently available beta on the development downloads page, it’s about 24 days old though most of the commits since b18 are fairly minor. I’d be tempted to give b18 a go.

Bit sneaky changing things like that, first time I have heard of rolling releases. Think I will stick with my slow moving Debian :)

Gary

Cat22

unread,
Apr 25, 2020, 5:44:34 AM4/25/20
to weewx-development
I  got into openSuse because we switched to it at work back around 200X and I decided it would be a good thing to follow suit. We ran debian for our development servers but we use suse for testing. I just cant make up my mind about debian. maybe i'll install it in virtualbox and try it out. If I do switch i have 4 systems that will need to be switched so its not a real big deal but it does involve some work on my part to get everything re-orged and reconfig'd for my liking.
For me weewx is a big item because so many of my neighbors rely on my weather website.
Can i run 3.9.2 on debian inside a virtualbox? Will i still be able to access the Davis Vantage Pro II usb connection?

gjr80

unread,
Apr 25, 2020, 5:55:27 AM4/25/20
to weewx-development
Haven’t used any USB under virtualbox, do all my WeeWX development work on Debian VMs under virtualbox but just use simulator, never with a live station.

Give 4b18 a go, only said to hold off to keep things simple, but then I encountered tumbleweed.

Gary

Cat22

unread,
Apr 25, 2020, 5:59:13 AM4/25/20
to weewx-development
I will try it via virtualbox and see how it goes. I'll post back here in a couple of days and let you know how i am doing.
Thanks again for your help.

Cat22

unread,
Apr 25, 2020, 7:12:49 AM4/25/20
to weewx-development


On Saturday, April 25, 2020 at 2:59:13 AM UTC-7, Cat22 wrote:
I will try it via virtualbox and see how it goes. I'll post back here in a couple of days and let you know how i am doing.
Thanks again for your help.

gjr80

unread,
Apr 25, 2020, 7:36:50 AM4/25/20
to weewx-development
Looks about right or it’s amd64 friend for 64bit.

Gary

Cat22

unread,
Apr 25, 2020, 7:42:53 AM4/25/20
to weewx-development
Are you sure its not 32 bit? i386 sounds 32 bit to me but thats what i am installing as we speak. I hope it turns out to be 64 bit

Cat22

unread,
Apr 25, 2020, 7:44:55 AM4/25/20
to weewx-development
Ok, my bad - i thought the amd64 said arm64 - I will restart the install

gjr80

unread,
Apr 25, 2020, 7:47:58 AM4/25/20
to weewx-development
Yes i386 is 32 bit, amd64 is 64bit. Which you use depends how you setup your VM, or how you setup your VM will determine which ISO. Either will be fine.

Gary

Tom Keffer

unread,
Apr 25, 2020, 8:26:51 AM4/25/20
to gjr80, weewx-development
Slow down there...

I don't have Tumbleweed handy, but I do have Leap 15.1 on a VM. I tried updating it and, yes, it did remove pyserial and configobj. Amazing.

However, they were easily reinstalled with

sudo zypper install python2-pyserial
sudo zypper install python2-configobj

Did you try that?

-tk



--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/79fd52e3-54a9-436b-b934-0e50476cdca0%40googlegroups.com.

Cat22

unread,
Apr 25, 2020, 10:29:50 AM4/25/20
to weewx-development
Neither of those work on my system
e.g

# zypper install python2-pyserial

Loading repository data...
Reading installed packages...
'python2-pyserial' not found in package names. Trying capabilities.
No provider of 'python2-pyserial' found.

Resolving package dependencies...

Nothing to do.
# zypper install python2-configobj

Loading repository data...
Reading installed packages...
'python2-configobj' not found in package names. Trying capabilities.
No provider of 'python2-configobj' found.

Resolving package dependencies...

Nothing to do.

I am also having issues with serial missing on debian-buster. It seems like the same rabbit hole



Tom Keffer

unread,
Apr 25, 2020, 11:03:12 AM4/25/20
to Cat22, weewx-development
1. Did you do "sudo zypper update" before trying?
2. Perhaps the difference is a Tumbleweed/Leap difference. Do you have to be on Tumbleweed?

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Cat22

unread,
Apr 25, 2020, 11:13:37 AM4/25/20
to weewx-development
I would prefer to stay on TW instead of reformatting to get back to 15.1
I just filed a bug on TW about this.
Everything has been working fine until a recent update (last couple of days actually)


Message has been deleted

Cat22

unread,
Apr 25, 2020, 12:16:20 PM4/25/20
to weewx-development
I found
      python2-configobj-5.0.6-3.9.noarch.rpm
      python2-pyserial-3.4-3.17.noarch.rpm
on
and manually installed both using rpm -i
and now weewx is working!
I checked /var/log/zypp/history
and found this:
   2020-04-23 15:13:40|remove |python2-pyserial|3.4-3.5|noarch||
   2020-04-23 15:13:41|remove |python2-configobj|5.0.6-3.6|noarch||
So as i suspected an update removed those packages. I have no idea why tho.
It also removed a bunch of other python 2.7 packages but installed (updated)the python 2 base stuff:
020-04-23 15:13:40|install|python-base|2.7.17-7.2|x86_64||download.opensuse.org-oss|ca03bbac9002d8afcadd2d7201ba894198b0111954e4ec82bc7001fd5edeb45d|

Its very strange because it removed a lot of python 2 but then installed a lot of other python 2 things.



Tom Keffer

unread,
Apr 25, 2020, 12:18:59 PM4/25/20
to Cat22, weewx-development
That's what happened on my VM as well. Inexcusable that a seemingly innocuous update would remove something without an upwardly compatible replacement. 

Or, switch to Debian? 😀

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Cat22

unread,
Apr 25, 2020, 12:21:18 PM4/25/20
to weewx-development
Here is the bug if anyone wants to follow it:

I tried Debian Buster in virtualbox and had the same issues appear

Tom Keffer

unread,
Apr 25, 2020, 12:34:59 PM4/25/20
to Cat22, weewx-development
I tried Debian Buster in virtualbox and had the same issues appear


I'm not following. Are you saying that a Buster upgrade removed pyserial and configobj?

Cat22

unread,
Apr 25, 2020, 1:37:03 PM4/25/20
to weewx-development


On Saturday, April 25, 2020 at 9:34:59 AM UTC-7, Tom Keffer wrote:
I tried Debian Buster in virtualbox and had the same issues appear


I'm not following. Are you saying that a Buster upgrade removed pyserial and configobj?

No, I tried Buster by installing Debian in virtualbox as an alternative to just running it in TW and
ran into the same issue. Later I found the 2 rpm's and installed those in TW and got it going again

gjr80

unread,
Apr 25, 2020, 4:10:04 PM4/25/20
to weewx-development
On Sunday, 26 April 2020 02:34:59 UTC+10, Tom Keffer wrote:
I tried Debian Buster in virtualbox and had the same issues appear


I'm not following. Are you saying that a Buster upgrade removed pyserial and configobj?
 
That concerned me too, tried using serial under python2 on my desktop which runs buster but not WeeWX. Not found but not surprising since I've never run WeeWX on this machine, a quick apt-get install fixed that. Configobj imported fine as I have used that with non-WeeWX code.  So buster is fine.

Gary

gary@flamingo:~$ lsb_release -da
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 10 (buster)
Release:    10
Codename:    buster

gary@flamingo
:~$ cat /etc/debian_version
10.3

gary@flamingo
:~$ python2
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
ImportError: No module named serial
>>> quit()
gary@flamingo
:~$ sudo apt-get install python-serial
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  python
-serial
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 83.0 kB of archives.
After this operation, 442 kB of additional disk space will be used.
Get:1 http://ftp.au.debian.org/debian buster/main amd64 python-serial all 3.4-4 [83.0 kB]
Fetched 83.0 kB in 0s (380 kB/s)      
Selecting previously unselected package python-serial.
(Reading database ... 528043 files and directories currently installed.)
Preparing to unpack .../python-serial_3.4-4_all.deb ...
Unpacking python-serial (3.4-4) ...
Setting up python-serial (3.4-4) ...

gary@flamingo
:~$ python2
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> serial.__version__
'3.4'
>>>quit()


Cat22

unread,
Apr 27, 2020, 7:45:46 PM4/27/20
to weewx-development

Here is the result of the bug I filed which has been closed by them as "wont fix":
"Yes, we are removing all python2 packages from the distribution.
If weewx maintainers haven’t noticed switch to python3 for eleven years, than you should complain with them."

sooooo.....

Greg Troxel

unread,
Apr 27, 2020, 7:49:46 PM4/27/20
to Cat22, weewx-development
Up to you to decide what distribution/packaging system you want to use,
but as someone who maintains a packaging system (pkgsrc), I see outright
removal of all python2 packages as overly aggressive and not in the
interest of users. There are lots of packages that work with python2
and not python3. Yes, the number is shrinking steadily, but it's still
at the level where outright removal of python2 causes a lot of
collateral damage.

Besides, weewx 4 is coming soon.

Tom Keffer

unread,
Apr 27, 2020, 8:20:45 PM4/27/20
to weewx-development
I agree.

I could possibly understand removing the python 2 packages from a distribution, but removing them from a user's machine is never excusable. A policy like that is guaranteed to break something and, indeed, it did.

Good reasons to switch to Debian. :-)

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages