module 'serial' has no attribute 'Serial'

253 views
Skip to first unread message

Adam Ellsworth

unread,
Apr 28, 2024, 3:28:37 PM4/28/24
to weewx-user
Hello, I've been running weewx smoothly for years, recently there was a power outage and when it came back up, weewx won't start.

I assume something got updated and broke.. something? In an attempt to fix it I installed the latest weewx 5.0.1... It's using python 3.8.10 says the log. I re-ran station reconfigure to see if the driver was obsolete.

Any ideas? Log below. Thank you for any suggestions! Usually I'm better at Google than this, but I'm also pretty unfamiliar with python.

Apr 28 10:51:35 homebox weewxd[326279]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Apr 28 10:51:36 homebox weewxd[326279]: ERROR weewx.engine: Import of driver failed: module 'serial' has no attribute 'Serial' (<class 'AttributeError'>)
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in setupStation
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 32, in loader
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 2046, in __init__
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 536, in __init__
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****      self.port.openPort()
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 319, in openPort
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****      self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL weewx.engine:     ****  AttributeError: module 'serial' has no attribute 'Serial'
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL __main__: Unable to load driver: module 'serial' has no attribute 'Serial'
Apr 28 10:51:36 homebox weewxd[326279]: CRITICAL __main__:     ****  Exiting...

Tom Keffer

unread,
Apr 28, 2024, 3:45:27 PM4/28/24
to weewx...@googlegroups.com
I've seen this error before. Did you by any chance do a pip install of "serial", instead of "pyserial"? The former is for serializing JSON, the latter for communicating with serial ports.

--
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/06f878e5-0950-4b34-9ce9-1573ab380c64n%40googlegroups.com.

Adam Ellsworth

unread,
Apr 29, 2024, 10:23:39 AM4/29/24
to weewx-user
That did it! I really appreciate the help and I'm glad I had the sense to ask, that would've taken me quite awhile to find.

I tried to do some grep'ing to see if anything else used the JSON library and didn't find anything, so I removed it. Hopefully it doesn't break something else. That's an unfortunate name collision... I'm surprised the pip system doesn't enforce unique namespaces to prevent this, but again I'm not a python guy.

Reply all
Reply to author
Forward
0 new messages