micropython-async icon indicating copy to clipboard operation
micropython-async copied to clipboard

ImportError: no module named 'primitives'

Open Curt-is-Pi opened this issue 3 years ago • 3 comments

Hello,

I am having an issue using the primitives modules. I get the 'ImportError: no module named 'primitives'' message any time I try to import a primitive. I can import uasyncio and print it's version though, 3,0,0. Any thoughts on what I maybe doing wrong? Keep in mind that I am Very new to programming so its most likely very basic .

Curt-is-Pi avatar May 31 '21 19:05 Curt-is-Pi

Please see the docs for installation instructions.

peterhinch avatar Jun 01 '21 08:06 peterhinch

I just hit this issue as well. Searched around for a while then noticed that instruction in the docs and later found this issue. Can I ask why uasyncio is included in the MicroPython release but this part of it is not?

I guess this question is analogous to asking why are they are in a different package? E.g. why is it from primitives.queue import Queue and not from uasyncio import Queue like the parent asyncio?

bulletmark avatar Jul 02 '21 04:07 bulletmark

The reason is that uasyncio is an official part of MicroPython written by @dpgeorge. This repo is entirely unofficial and maintained by myself. A subset of the primitives aim to replicate those provided with CPython asyncio. I expect that, in due course, official versions of those classes will be written and I will retire my versions.

peterhinch avatar Jul 02 '21 11:07 peterhinch