Installation#

Note

Alpha release — PyMCU is currently in alpha (0.1.0a1). By default, pip, uv and pipx do not install pre-releases unless you pass a --pre flag. The commands on this page include the required flags. Once 0.1.0 stable ships, --pre will not be needed.


Option 3 — Build from source#

For contributors or anyone who wants to run the latest development build.

Requirements#

  • .NET 10 SDK

  • Python 3.11 or newer

  • uv (recommended)

  • avrdude (for flashing — see below)

Steps#

git clone https://github.com/pymcu/pymcu.git
cd pymcu

# Build the C# compiler and AVR backend
dotnet publish src/compiler/PyMCU.csproj -c Release -o build/bin --nologo
dotnet publish extensions/pymcu-avr/src/csharp/cli/PyMCU.AVR.csproj -c Release -o build/bin --nologo

# Set up Python environment
uv venv && source .venv/bin/activate
uv sync
just sync-stdlib   # editable stdlib (uv pip install --no-deps -e lib/); edits are then live
pip install -e src/driver

Verify:

pymcu --version
# pymcu-compiler, version 0.1.0a1

Flash the firmware#

Compiling produces dist/firmware.hex. Flashing to an Arduino Uno requires avrdude installed on your host machine.

brew install avrdude
sudo apt-get install avrdude

Download from the AVRDUDE releases page.

Then use pymcu flash (which calls avrdude internally):

pymcu flash --port /dev/cu.usbmodem*   # macOS
pymcu flash --port /dev/ttyACM0        # Linux
pymcu flash --port COM3                # Windows

Or call avrdude directly:

avrdude -c arduino -p atmega328p -P /dev/ttyACM0 -b 115200 \
        -U flash:w:dist/firmware.hex:i

Next steps#

  • Quick Start — create your first project and flash an LED