njouanin / hbmqtt

MQTT client/broker using Python asynchronous I/O
MIT License
795 stars 188 forks source link

Fix import -> from websockets.protocol import WebSocketCommonProtocol #245

Closed ghost closed 2 years ago

ghost commented 2 years ago
  File "/home/alejo/Documentos/ikono/whapi/whapi_program/broker.py", line 1, in <module>
    from  hbmqtt.broker import Broker
  File "/home/alejo/.local/lib/python3.8/site-packages/hbmqtt/broker.py", line 15, in <module>
    from hbmqtt.session import Session
  File "/home/alejo/.local/lib/python3.8/site-packages/hbmqtt/session.py", line 8, in <module>
    from hbmqtt.mqtt.publish import PublishPacket
  File "/home/alejo/.local/lib/python3.8/site-packages/hbmqtt/mqtt/__init__.py", line 5, in <module>
    from hbmqtt.mqtt.packet import (
  File "/home/alejo/.local/lib/python3.8/site-packages/hbmqtt/mqtt/packet.py", line 8, in <module>
    from hbmqtt.adapters import ReaderAdapter, WriterAdapter
  File "/home/alejo/.local/lib/python3.8/site-packages/hbmqtt/adapters.py", line 6, in <module>
    from websockets.protocol import WebSocketCommonProtocol
ModuleNotFoundError: No module named 'websockets.protocol'
gwbres commented 2 years ago

Hello @Alejo0290 ,

I would recommend you switch to amqtt because hbmqtt is presently not maintained, and is facing more & more issues. amqtt is actively maintained, they fixed websockets related issues (your patch is not enough) and work towards modern python version supports