Install & Set Up MicroPython
Prerequisites
-
Hardware
- Raspberry Pi Pico W (RP2040 + Wi-Fi)
- Pimoroni Explorer Pico W extension board (provides motors, analog sensors, capacitive touch, LEDs, and more)
- USB data cable (USB-A/USB-C to micro-USB)
-
Software
- Visual Studio Code installed
- Raspberry Pi Pico extension for VS Code
Why use the extension?
The official Raspberry Pi Pico extension streamlines:
- Creating a MicroPython project
- Opening a REPL
- Uploading files to the Pico W
note
Alternatively, you can use Wyliodrin Studio.
1) Install the Raspberry Pi Pico extension
- Open VS Code.
- Go to Extensions (left sidebar) -> search for "Raspberry Pi Pico".
- Install the extension published by Raspberry Pi.
2) How to open the VS Code Command Palette
The Command Palette is where you access all extension commands.
- Windows / Linux: Press
Ctrl + Shift + P
- macOS: Press
Cmd + Shift + P
You can also open it from the menu: View -> Command Palette...
3) Create a MicroPython project (via the extension)
- Open the Command Palette (
Ctrl/Cmd + Shift + P
). - Search for and select:
Pico: New Project (MicroPython)
. - Choose a folder for your project.
- When asked for Board, pick Raspberry Pi Pico W.
4) Flash the MicroPython firmware
If firmware was already flashed, skip to step 5.
- Unplug the Pico W from USB.
- Hold down the BOOTSEL button on the Pico.
- While holding, connect the USB cable to your computer.
- Release the button when a USB mass-storage drive (e.g.,
RPI-RP2
) appears. - Download the latest release for pimoroni picow micropython from the releases page.
- Copy the
.uf2
file to theRPI-RP2
drive.
5) Common VS Code commands for Pico W
Open the Command Palette and look for:
Pico: New Project (MicroPython)
Pico: Flash MicroPython (UF2)
Pico: Open REPL
Pico: Upload Project to Pico
6) Troubleshooting
The RPI-RP2
drive doesn't appear (BOOTSEL)
- Try a different USB cable (some are charge-only).
- Hold BOOTSEL, plug in, then release after connecting.
- Use a direct USB port (avoid hubs).
REPL/serial port not found
-
Windows: Check Device Manager -> Ports (COM & LPT).
-
macOS: Look for
/dev/tty.usbmodem*
. -
Linux: Look for
/dev/ttyACM*
. You may need to add your user to thedialout
group and re-login:sudo usermod -a -G dialout $USER
If still blocked, confirm your udev rules allow access to
ttyACM
.
Upload succeeds but nothing runs
- Open the REPL to see exceptions printed at startup.