balena-io-examples / internetspeedtest

Log your internet download, upload and ping metrics ti influxDB, and Grafana it. Grafana all the things!
GNU General Public License v3.0
57 stars 18 forks source link

ModuleNotFoundError: No module named 'typing_extensions' #24

Open aboFaisal opened 5 months ago

aboFaisal commented 5 months ago

I deplyed it in my Raspberry Pi 5 using belana, but the graph didn't show any data. and When I checked speedtest service log in belana I found the following:

speedtest  Traceback (most recent call last):
speedtest    File "./speedtest.py", line 5, in <module>
speedtest      import paho.mqtt.client as mqtt
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 51, in <module>
speedtest      from typing_extensions import Literal  # type: ignore
speedtest  ModuleNotFoundError: No module named 'typing_extensions'
speedtest  OKTraceback (most recent call last):
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 49, in <module>
speedtest      from typing import Literal
speedtest  ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py)
speedtest  
speedtest  During handling of the above exception, another exception occurred:
speedtest  
speedtest  Traceback (most recent call last):
speedtest    File "./speedtest.py", line 5, in <module>
speedtest      import paho.mqtt.client as mqtt
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 51, in <module>
speedtest      from typing_extensions import Literal  # type: ignore
speedtest  ModuleNotFoundError: No module named 'typing_extensions'
speedtest  OKTraceback (most recent call last):
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 49, in <module>
speedtest      from typing import Literal
speedtest  ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py)
speedtest  
speedtest  During handling of the above exception, another exception occurred:
speedtest  
speedtest  Traceback (most recent call last):
speedtest    File "./speedtest.py", line 5, in <module>
speedtest      import paho.mqtt.client as mqtt
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 51, in <module>
speedtest      from typing_extensions import Literal  # type: ignore
speedtest  ModuleNotFoundError: No module named 'typing_extensions'
speedtest  OKTraceback (most recent call last):
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 49, in <module>
speedtest  OKTraceback (most recent call last):
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 49, in <module>
speedtest      from typing import Literal
speedtest  ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py)
speedtest  
speedtest  During handling of the above exception, another exception occurred:
speedtest  
speedtest  Traceback (most recent call last):
speedtest    File "./speedtest.py", line 5, in <module>
speedtest      import paho.mqtt.client as mqtt
speedtest    File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 51, in <module>
speedtest      from typing_extensions import Literal  # type: ignore
speedtest  ModuleNotFoundError: No module named 'typing_extensions'
phil-d-wilson commented 5 months ago

Hey @aboFaisal

It looks like Paho MQTT bumped by a major version which included some breaking changes: https://eclipse.dev/paho/files/paho.mqtt.python/html/changelog.html

And the version wasn't pinned in this project. I'll pin it to version 1.6.1 for now since I can't spot a super urgent reason to use the latest (i.e. no security issues) and the migration to 2.0 looks like it might take a while (PRs welcome).

I'm on it.

phil-d-wilson commented 5 months ago

Pinning to 1.6.1 gets this project working again - so I'll PR that change now.