support
support copied to clipboard
[Bug] ImportError: no module named 'typing'
Describe the bug
I want to write typed programs and run them on the Spike Prime hub, but I always get ImportError: no module named 'typing'.
To reproduce
- Write a test.py with
from typing import Dict -
pybricksdev run ble test.py - get error:
ImportError: no module named 'typing'
Expected behavior I don't fully understand the python typing system but I roughly thought it would be "compiled out" and have no runtime overhead. I found https://micropython-stubs.readthedocs.io/en/main/typing_mpy.html which describes typing stubs for micropython, but it wasn't clear whether or how I could use this with pybricks.