openmv uasyncio AttributeError: 'module' object has no attribute 'deque'

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Posts: 59
Joined: Wed Mar 11, 2015 6:21 am

openmv uasyncio AttributeError: 'module' object has no attribute 'deque'

Post by skylin008 » Sun Feb 23, 2020 9:03 am

Hello everyone! I had One Openmv4,the firmware information is: MicroPython v1.11-omv OpenMV v3.5.1 2019-12-06; OPENMV4-STM32H743. I had accroding to the ... guide detail description doc and copy the file to uasyncio folder.But when run as follow on openmv4, the error information shows :

File "F:\", line 49, in <module>

File "uasyncio/", line 224, in get_event_loop

File "uasyncio/", line 21, in __init__

File "uasyncio/", line 30, in __init__

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

the code is:

Code: Select all

import uasyncio as asyncio

import gc

from pyb import UART

uart = UART(3, 9600)

async def sender():
    Swriter = asyncio.StreamWriter(uart, {})
        while True:
            await Swriter.awrite('READY\r\n12345265464563463463456346\r\n')
            await asyncio.sleep_ms(10)
    except asyncio.CancelledError:
        print('Sender Cancelled')
async def receiver():
    Sreader = asyncio.StreamReader(uart)            
        while True:
            res = await Sreader.readline()
            #res = await Sreader.readexactly(5)
            res_str = res.decode('utf-8') 
            if (res):                               
                print("Received", res)           
    except asyncio.CancelledError:
        print('Receiver Cancelled')
async def _gc():
    while True:
        await asyncio.sleep_ms(1)
        gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())

loop = asyncio.get_event_loop()

How to solve this issue.Thanks!

User avatar
Posts: 4030
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: openmv uasyncio AttributeError: 'module' object has no attribute 'deque'

Post by pythoncoder » Sun Feb 23, 2020 10:37 am

See my comment to your GitHub query.
Peter Hinch

Post Reply