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