Installing uasyncio V3

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
rx8pilot
Posts: 5
Joined: Fri Mar 26, 2021 3:39 am

Installing uasyncio V3

Post by rx8pilot » Tue Apr 13, 2021 11:38 pm

I am trying to figure out how to install uasyncio V3 and other modules in general.

So far, I have tried upip - but that seems so have installed the older version (not even sure how to verify version)
I am curious how to manually download and install it (without upip or a network connection). At the moment, I am using VS Code Pymaker to push/pull files over UART. That has been pretty good for the basic tests and learning I have been doing in Micropython.

What is the best way to get the latest asyncio module and configure it onto my ESP32 dev board?

I am guessing that figuring this out will help with any other module. Any help is appreciated.

rx8pilot
Posts: 5
Joined: Fri Mar 26, 2021 3:39 am

Re: Installing uasyncio V3

Post by rx8pilot » Wed Apr 14, 2021 4:15 am

UPDATE:

I learned a few things in the past few hours....uAsyncio is a built-in module and I was running an older version of uPython. I updated the firmware to a newer generic ESP32 build and installed that with esptool utility.

To check the version of uasyncio:

Code: Select all

>>> import uasyncio as asyncio
asyncio.__version__
(3, 0, 0)
Previously - this did not even work so I guess I am getting somewhere. The test code I have been hacking on seems to be working.

I am still not clear how to best get the most current build - compile from source perhaps. Also not clear on how to best manage non standard modules.

User avatar
pythoncoder
Posts: 5144
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Installing uasyncio V3

Post by pythoncoder » Wed Apr 14, 2021 9:22 am

In general there is no need to compile from source, unless you want to use "advanced" features like frozen bytecode. Daily builds are available here - simply download and install the latest "unstable" build. Despite the name, automated testing ensures that problems with these builds are very rare.

As for libraries, official libraries and some user libraries can be installed with upip. Others will have their own documentation and installation instructions. In particular, user libraries intended to be usable on non-networked targets are sometimes installed by copying files to the device filesystem.
Peter Hinch

rx8pilot
Posts: 5
Joined: Fri Mar 26, 2021 3:39 am

Re: Installing uasyncio V3

Post by rx8pilot » Fri Apr 16, 2021 1:20 am

Thank you, makes sense.

As a side note, I now know how to compile micropython from source even if it is not needed. :-)

As for upip, is that intended to be used from the desktop command line - or just a device running micropython with a network connection?

I am using VS Code and trying to figure out how to manage modules from there as well as gain the Intellisense.

User avatar
pythoncoder
Posts: 5144
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Installing uasyncio V3

Post by pythoncoder » Fri Apr 16, 2021 11:30 am

upip is intended to run on a device with a network connection. For non-networked targets there is micropip which runs under CPython and enables libraries to be installed to a PC's filesystem: the result can then be copied to the target's filesystem.
Peter Hinch

Post Reply