tomdotorg / docker-weewx

Docker image for weewx weather software
https://hub.docker.com/r/mitct02/weewx/
Apache License 2.0
23 stars 13 forks source link

Trying to add GW1000 driver and failing with no module named six #10

Open uktricky opened 3 weeks ago

uktricky commented 3 weeks ago

Hi, using your v5 Dockerfile to build a new version of WeeWx which works OK

Everything was up and running with the simulator engine but I've now tried to add the GW1000 I've downloaded the gw1000.py and stored this in my docker directory

My run command:

docker run \
-d \
-e TZ='Europe/London' \
-v /home/tricky/docker/weewx/weewx.conf:/home/weewx/weewx-data/weewx.conf \
-v /home/tricky/docker/weewx/db:/home/weewx/weewx-data/archive \
-v /home/tricky/docker/webserver/:/home/weewx/weewx-data/public_html/ \
-v /home/tricky/docker/weewx/usrbin/gw1000.py:/home/weewx/weewx-data/bin/user/gw1000.py \
--name weewx \
tricky-weewx:latest

My logs show:

2024-10-30 17:12:25,675 weewxd[26] INFO __main__: Groups:       weewx
2024-10-30 17:12:25,675 weewxd[26] INFO weewx.engine: Loading station type GW1000 (user.gw1000)
2024-10-30 17:12:25,680 weewxd[26] CRITICAL __main__: Caught unrecoverable exception:
2024-10-30 17:12:25,681 weewxd[26] CRITICAL __main__:     ****  No module named 'six'
2024-10-30 17:12:25,691 weewxd[26] CRITICAL __main__:     ****  Traceback (most recent call last):

2024-10-30 17:12:25,691 weewxd[26] CRITICAL __main__:     ****    File "/home/weewx/weewx/src/weewxd.py", line 121, in main

2024-10-30 17:12:25,691 weewxd[26] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)

2024-10-30 17:12:25,691 weewxd[26] CRITICAL __main__:     ****               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-10-30 17:12:25,691 weewxd[26] CRITICAL __main__:     ****    File "/home/weewx/weewx/src/weewx/engine.py", line 80, in __init__

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****      self.setupStation(config_dict)

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****    File "/home/weewx/weewx/src/weewx/engine.py", line 104, in setupStation

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****      __import__(driver)

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****    File "/home/weewx/weewx-data/bin/user/gw1000.py", line 373, in <module>

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****      import six

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****  ModuleNotFoundError: No module named 'six'

2024-10-30 17:12:25,692 weewxd[26] CRITICAL __main__:     ****  Exiting.
Traceback (most recent call last):
  File "/home/weewx/weewx/src/weewxd.py", line 226, in <module>
    main()
  File "/home/weewx/weewx/src/weewxd.py", line 121, in main
    engine = weewx.engine.StdEngine(config_dict)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/weewx/weewx/src/weewx/engine.py", line 80, in __init__
    self.setupStation(config_dict)
  File "/home/weewx/weewx/src/weewx/engine.py", line 104, in setupStation
    __import__(driver)
  File "/home/weewx/weewx-data/bin/user/gw1000.py", line 373, in <module>
    import six
ModuleNotFoundError: No module named 'six'

In my weewx.conf (which is what I have in my non-docker version of weewx which is about 4 years old now):


    station_type = GW1000

[GW1000]
    # This section is for the Ecowitt Gateway driver.

    # How often to poll the API, default is every 20 seconds:
    poll_interval = 20

    # The driver to use:
    driver = user.gw1000
    ip_address = 10.1.2.3
    port = 45000
uktricky commented 3 weeks ago

Requires the library installed - Amended the Dockerfile to include:


RUN apt-get update \
    &&  apt-get install wget unzip python3 python3-dev python3-pip python3-venv tzdata rsync openssh-client openssl git libffi-dev python3-setuptools libjpeg-dev **python3-six** -y \
    &&  addgroup weewx \
    && useradd -m -g weewx weewx \

and also

    && python3 -m pip install paho-mqtt \
    **&& python3 -m pip install six \**
    # If your hardware uses a serial port
    && python3 -m pip install pyserial \
vinceskahan commented 3 weeks ago

(not Tom but....) it is reasonable to assume that any docker setup will sometimes require additions if you choose to add things to it, especially drivers. Not a bug re: this repo in my opinion.