# Micropython-urllib.urequest

**URL:** <https://forums.pimoroni.com/t/micropython-urllib-urequest/23329>\
**Category:** Support\
**Created:** [November 22, 2023, 10:07am UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329 "2023-11-22T10:07:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfairman](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rfairman](https://forums.pimoroni.com/u/rfairman)\
**Post date:** [November 22, 2023, 10:07am UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/1 "2023-11-22T10:07:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [November 22, 2023, 10:39am UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/2 "2023-11-22T10:39:05Z")

</div>

There’s a compiled version here:

> <https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/common>
>
> //github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/common

---

<div class="post-metadata">

**Author:** ![rfairman](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rfairman](https://forums.pimoroni.com/u/rfairman)\
**Post date:** [November 22, 2023, 11:05am UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/3 "2023-11-22T11:05:29Z")

</div>

thanks

i get the below error

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

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [November 22, 2023, 12:12pm UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/4 "2023-11-22T12:12:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mgssnr](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mgssnr](https://forums.pimoroni.com/u/mgssnr)\
**Post date:** [November 26, 2023, 3:19pm UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/5 "2023-11-26T15:19:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mgssnr](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mgssnr](https://forums.pimoroni.com/u/mgssnr)\
**Post date:** [November 26, 2023, 3:21pm UTC](https://forums.pimoroni.com/t/micropython-urllib-urequest/23329/6 "2023-11-26T15:21:43Z")

</div>

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