I've searched and not found an answer.. I'm proficient in C and Micro-python and developing and running programs is easy enough.

However I can't figure out how I install a program I've written to the Pico so that when I supply it purely power it runs?

With ESP32 devices I would normally flash the program to NVMe ram and configure uboot to run it.

3 Answers 3


Using Thonny save your MicroPython file to the pico as a file called main.py

Next time you power on the Pico your program should autostart.

See section 4.1.1:



Or, if you don't want to use Thonny (I prefer to choose my own development environment), you can use ampy, a command-line tool for micropython boards.

Example usage:

ampy -p /dev/ttyACM0 put main.py

Note that to auto-run, your Python file needs to be called main.py.

  • Thanks I use C normally.. Buy I've been playing with micro python on the nano so its nice to know how to auto start it. Mar 1, 2021 at 19:07
  • 1
    @SimonBanks For C, I think you just build a UF2 binary, and drag that onto the Pico after booting it in programming mode? I haven't tried C on the Pico yet myself, but I think that's the method.
    – marcelm
    Mar 1, 2021 at 20:48
  • Many Thanks that makes sense.. Mar 2, 2021 at 14:39
  • @SimonBanks By the way, the Pico also has a single-wire debugging interface (the 3 pads on the short side). I think you can also program it over that interface, but I really haven't researched that yet :)
    – marcelm
    Mar 2, 2021 at 14:53

I met only with failure to have main.py run on the Pico at boot until I realized the file had been saved on the Pico through Thonny WITHOUT the .py extension. Ridiculous, but it may explain why many have had the same problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.