Comparison

MicroPython vs Python

MicroPython keeps Python syntax and a subset of Python behavior for microcontrollers and constrained systems, while Python is the full general-purpose ecosystem for scripts, services, data, applications, and libraries on conventional computers.

Scope

This comparison is for teams deciding whether a Python-like workflow belongs on a microcontroller, board, device, or constrained embedded target. It is not about choosing between MicroPython and CPython for a normal server, desktop script, notebook, or data application.

The short version: choose Python for the full ecosystem on conventional computers. Choose MicroPython when the program must run on a supported device with tight RAM, flash, peripheral, and deployment constraints.

Shared Territory

MicroPython deliberately feels familiar to Python developers. It uses Python syntax, dynamic runtime typing, familiar core data structures, imports, exceptions, functions, classes, comprehensions, and an interactive prompt. That makes it a strong teaching and prototyping bridge from desktop Python to hardware.

The overlap should not be overstated. MicroPython aims at Python 3.4 syntax with selected later features and documents differences from CPython. Its libraries are "micro" versions or MicroPython-specific modules, and individual ports may omit documented functionality because of resource limits or firmware configuration.

Key Differences

DimensionMicroPythonPython
TargetMicrocontrollers, constrained systems, selected portsDesktops, servers, notebooks, tools, services, data
RuntimeCompact compiler and VM, often bare metalCPython bytecode VM and other full implementations
LibrariesSmall stdlib subset plus hardware modulesFull standard library plus broad third-party ecosystem
Packagesmip, mpremote, micropython-lib, copied/frozen codepip, PyPI, venv, pyproject.toml, ecosystem tools
Hardware accessmachine, port modules, board APIsUsually through OS APIs, native packages, or devices
Memory modelGC on constrained heap and stackGC/reference counting on much larger hosts in CPython
CompatibilityPython-like subset with documented CPython differencesReference point for most Python packages and tooling
DeploymentFirmware images, board filesystems, .mpy, serial toolsVirtual envs, containers, packages, system installs

Choose MicroPython When

  • The code must run directly on a microcontroller or constrained board.
  • Interactive hardware exploration, REPL access, and fast iteration are core to the workflow.
  • The board has a mature MicroPython port with the needed GPIO, I2C, SPI, UART, ADC, PWM, networking, sleep, and filesystem support.
  • The application logic is small enough to fit the board's RAM and flash with acceptable garbage-collection behavior.
  • Python familiarity is valuable for students, hardware teams, labs, prototyping, diagnostics, or device scripting.
  • Timing-critical and vendor-specific layers can stay in C or narrow native modules.

Choose Python When

  • The code runs on a desktop, server, laptop, Raspberry Pi-class Linux system, cloud host, or build machine.
  • The project needs the full standard library, PyPI packages, native wheels, notebooks, data libraries, web frameworks, or mature packaging workflows.
  • CPython compatibility is required for third-party modules, tools, type checkers, debuggers, linters, tests, or deployment.
  • Memory, storage, process management, filesystem access, and OS services are ordinary application resources.
  • The target hardware can run full Python under Linux or another operating system without the firmware constraints that MicroPython is designed around.

Watch Points

MicroPython's main risk is assuming that Python compatibility means CPython compatibility. Test the exact board, firmware version, port tier, enabled modules, package format, and memory budget before committing. Code that imports fine on a laptop can fail on a board because a module is absent, too large, or implemented differently.

Python's main risk in embedded conversations is assuming that a Linux Python workflow maps to bare metal. If the device is really a microcontroller with vendor startup code, flash limits, interrupts, and peripheral registers, full Python may not fit at all.

Practical Default

Start with Python for host-side tools, data processing, tests, build scripts, dashboards, notebooks, and services.

Use MicroPython on the device when the target board supports it well and the value is interactive hardware development, small scripts, education, diagnostics, or high-level device behavior. Keep the option open to move timing-sensitive or memory-sensitive code into C, native modules, or a different firmware stack.

Sources

Last verified:

  1. MicroPython homepage MicroPython
  2. MicroPython v1.28.0 documentation MicroPython
  3. MicroPython language and implementation MicroPython
  4. MicroPython differences from CPython MicroPython
  5. MicroPython libraries MicroPython
  6. Package management MicroPython
  7. Python Documentation Python Software Foundation
  8. The Python Language Reference Python Software Foundation
  9. The Python Standard Library Python Software Foundation
  10. Python Packaging User Guide Python Packaging Authority