Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old paho-mqtt version generates: No module named 'paho.mqtt.enums' #2

Closed
yellowonblack opened this issue Jun 6, 2024 · 3 comments
Closed

Comments

@yellowonblack
Copy link

Using the actual Dockerfile to build 0.1.1 is installing paho-mqtt 1.5.0 which does not contain enums.py. and generates the following error:

ModuleNotFoundError: No module named 'paho.mqtt.enums'
Traceback (most recent call last):
  File "/app/device_tracker.py", line 6, in <module>
    import paho.mqtt.enums as mqtt_enums

Removing "apt install python3-paho-mqtt --yes && " and updating "RUN python3 -m pip install paho-mqtt unifi-tracker" will install paho-mqtt 2.1.0 from pip repository which will fix the issue.

@idatum
Copy link
Owner

idatum commented Jun 6, 2024

Thanks. Looks I get paho-mqtt 2.0 on my Debian 12 apt-get. I'll add your change to the Dockerfile and make a note that minimum v2.0 of paho-mqtt needed.

@yellowonblack
Copy link
Author

I did further tests with the Debian versions and by default "apt install python3-paho-mqtt " installs the following:

  • Debian 11 (debian:bullseye-slim) - paho-mqtt==1.5.1
  • Debian 12 (debian:bookwarm-slim) - paho-mqtt==1.6.1
  • Debian 13 (debian:trixie-slim)- paho-mqtt==2.0.0

idatum pushed a commit that referenced this issue Jun 7, 2024
@idatum
Copy link
Owner

idatum commented Jun 7, 2024

I added optional dependency:
[project.optional-dependencies]
paho-mqtt = ["paho-mqtt>=2.0"]
Use:
python3 -m pip install unifi_tracker[paho-mqtt]
to include paho-mqtt >= 2.0.
Updated Dockerfile.

@idatum idatum closed this as completed Jun 7, 2024
idatum pushed a commit that referenced this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants