Skip to content

[Bug] ImportError: no module named 'typing' #2437

@abliss

Description

@abliss

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

  1. Write a test.py with from typing import Dict
  2. pybricksdev run ble test.py
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssues that have not been triaged yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions