pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.32k stars 496 forks source link

Error: no module named 'urllib' on pico inky examples on Pico W #438

Closed heggiedavid closed 2 years ago

heggiedavid commented 2 years ago

Running any of the network examples (eg. placekitten.py) on a Pico W with the 1.19.2 pimoroni UF2 gives the output below

MicroPython 99c2589 on 2022-07-07; Raspberry Pi Pico W with RP2040

Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
ImportError: no module named 'urllib'
helgibbons commented 2 years ago

You can install the missing requests library via '‘Tools’ > ‘Manage Packages’ in Thonny - search for micropython-urllib.urequest

I’ll see if I can make that more obvious in the examples / on the shop page…

heggiedavid commented 2 years ago

Perfect, that's a lot clearer. Thanks.