You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated my Docker images and came across the problem.
The server no longer starts with version 3.x of the werkzeug library.
Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.10/site-packages/hanazeder_server/mqtt.py", line 6, in <module> from quart import Quart File "/usr/local/lib/python3.10/site-packages/quart/__init__.py", line 5, in <module> from .app import Quart as Quart File "/usr/local/lib/python3.10/site-packages/quart/app.py", line 46, in <module> from werkzeug.urls import url_quote ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
If I go to version 2.2.2 of Werkzeug, I get the following error message. hanazeder | Traceback (most recent call last): hanazeder | File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main hanazeder | return _run_code(code, main_globals, None, hanazeder | File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code hanazeder | exec(code, run_globals) hanazeder | File "/usr/local/lib/python3.10/site-packages/hanazeder_server/mqtt.py", line 9, in <module> hanazeder | from hanazeder_server.MqttClient import MqttClient hanazeder | File "/usr/local/lib/python3.10/site-packages/hanazeder_server/MqttClient.py", line 1, in <module> hanazeder | from asyncio_mqtt import Client, ProtocolVersion, Will hanazeder | File "/usr/local/lib/python3.10/site-packages/asyncio_mqtt/__init__.py", line 3, in <module> hanazeder | from .client import Client, Will, ProtocolVersion hanazeder | File "/usr/local/lib/python3.10/site-packages/asyncio_mqtt/client.py", line 591, in <module> hanazeder | _PahoSocket = Union[socket.socket, mqtt.WebsocketWrapper] hanazeder | AttributeError: module 'paho.mqtt.client' has no attribute 'WebsocketWrapper'. Did you mean: '_WebsocketWrapper'?
I assume that's due to loose version specification in pyproject.toml. If you remove all the carets (the "^") in the section [tool.poetry.dependencies] it should always stick to the old versions. It should look something like this:
I don't have access to a Hanazeder unit anymore, do you think you could test that? You'd have to create the docker image from the local python sources instead of downloading a fixed version of hanazeder_server via pip install.
Hi,
I found a solution at the weekend. I can control the dependencies separately when building the Docker container. With this pip call I was able to create a working version again.
pip3 install --no-cache-dir hanazeder_server paho-mqtt==1.6.1 werkzeug==2.2.2
I updated my Docker images and came across the problem.
The server no longer starts with version 3.x of the werkzeug library.
Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.10/site-packages/hanazeder_server/mqtt.py", line 6, in <module> from quart import Quart File "/usr/local/lib/python3.10/site-packages/quart/__init__.py", line 5, in <module> from .app import Quart as Quart File "/usr/local/lib/python3.10/site-packages/quart/app.py", line 46, in <module> from werkzeug.urls import url_quote ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
If I go to version 2.2.2 of Werkzeug, I get the following error message.
hanazeder | Traceback (most recent call last): hanazeder | File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main hanazeder | return _run_code(code, main_globals, None, hanazeder | File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code hanazeder | exec(code, run_globals) hanazeder | File "/usr/local/lib/python3.10/site-packages/hanazeder_server/mqtt.py", line 9, in <module> hanazeder | from hanazeder_server.MqttClient import MqttClient hanazeder | File "/usr/local/lib/python3.10/site-packages/hanazeder_server/MqttClient.py", line 1, in <module> hanazeder | from asyncio_mqtt import Client, ProtocolVersion, Will hanazeder | File "/usr/local/lib/python3.10/site-packages/asyncio_mqtt/__init__.py", line 3, in <module> hanazeder | from .client import Client, Will, ProtocolVersion hanazeder | File "/usr/local/lib/python3.10/site-packages/asyncio_mqtt/client.py", line 591, in <module> hanazeder | _PahoSocket = Union[socket.socket, mqtt.WebsocketWrapper] hanazeder | AttributeError: module 'paho.mqtt.client' has no attribute 'WebsocketWrapper'. Did you mean: '_WebsocketWrapper'?
Dockerfile
`FROM python:3.10-alpine3.16
RUN apk update &&
apk add usbutils bash wget
RUN pip3 install --no-cache-dir --upgrade pip &&
pip3 install --no-cache-dir hanazeder_server
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]`
entrypoint.sh
`#!/bin/sh
python -m hanazeder_server.mqtt --serial-port /dev/..... --mqtt-server 192.168.x.x`
The text was updated successfully, but these errors were encountered: