Micropython-urllib.urequest

trying to get cheerlights code on Picoexplorer working

needs the above library to work but cannot find it to download.

thonny manage packages doe not work

There’s a compiled version here:

thanks

i get the below error

Traceback (most recent call last):
File “”, line 4, in
ImportError: can’t import name urequest

Have you copied the urllib directory to your Pico W? Not sure if it will work if urequest.mpy is in the root directory.

I generally just download the whole repo (there’s an option under the green Code button on the front page that will let you download it as a zip) and then copy the whole micropython/examples/common/lib directory to my Pico using Thonny’s files window.

Installing urllib.urequest via Thonny’s ‘manage packages’ is also working for me - might be worth updating your Thonny to the most recent version if you’re having trouble with that as I think there have been some changes to how MicroPython package management works.

This is good information, but I’m not able to copy any files using Thonny. I’m pretty confused by this.

I’m using a Mac. When I navigate to micropython/examples/common/lib, dragging files or directories from that directory to the pico w doesn’t do anything. Likewise, if I right click on lib and try to paste it to the pico w, there’s no paste option. Help!

Lastly, when I try to use Manage Packages, none of the options seems to make sense: Install from PyPI wouldn’t load something from a local source; Install from requirements.txt doesn’t work because there isn’t one; Install from local file sometimes crashes (Thonny 4.1.4) and sometimes opens a directory, but it won’t let me put the request.mpy file onto the pico w.

I’d appreciate any insight you can offer.

I found the process in another post. Select the folder/file and choose Upload to /. That’s not intuitive at all, but it works.

1 Like