← index #9048Issue #7266
Related · high · value 3.623
QUERY · ISSUE

Installing MicroPython Asyncio from Thonny Package Manager Successful, But import of uasyncio module fails?

openby Jibun-no-Kageopened 2022-08-13updated 2022-08-13
bug

Consistent and repeatable... ValueError: incompatible .mpy file results on module import. Installing MicroPython Asyncio from Thonny Package Manager Successful, But import of uasyncio module fails? Please fix.

Using latest nightly build same issue.

CANDIDATE · ISSUE

Import / AttributeError error in new asyncio

closedby DrTomopened 2021-05-15updated 2025-09-10
py-core

If some module imports with from uasyncio import * and then the this module
is imported somewhere else there will occur an AttributeError if e.g. start_server is invoked:

AttributeError: 'module' object has no attribute 'start_server'

The culprit is the "lazy loading" in: https://github.com/micropython/micropython/blob/master/extmod/uasyncio/init.py#L8-L30
Replacing the lazy loading with regular import solves the problem.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied