Skip to content
neilh edited this page Sep 19, 2015 · 28 revisions

Getting started with micropython development requires first building the appropriate binaries for your platform.

UNIX

Debian, Ubuntu, Mint, and variants

The following packages will need to be installed before you can compile and run MicroPython:

  • build-essential
  • libreadline-dev
  • libffi-dev
  • git

To install these packages, use the following command:

sudo apt-get install build-essential libreadline-dev libffi-dev git

Then, clone the repository to your local machine:

git clone https://github.com/micropython/micropython.git

Change directory to the Unix build directory:

cd ./micropython/unix

And then make the executable

make

At that point, you will have a functioning micropython executable, which may be launched with the command:

./micropython

FreeBSD

(Release 9.2 tested)

Ensure that you have git, GCC, gmake, pythyon3, and bash packages installed:

[as root] pkg_add -r git gcc gmake python3 bash

Clone the git repository to your local machine:

git clone https://github.com/micropython/micropython.git

Change directory to the Unix build directory:

cd ./micropython/unix

Edit main.c, replacing "malloc.h" with "stdlib.h", then:

gmake

This will generate the 'py' executable, which may be executed by:

./micropython

Fedora, CentOS, and Red Hat Enterprise Linux and variants

The required packages can be installed with:

sudo yum install git gcc readline-devel

Clone the git repository to your local machine:

git clone https://github.com/micropython/micropython.git

Change directory to the Unix build directory:

cd ./micropython/unix

And then make the executable

make

At that point, you will have a functioning micropython executable, which may be launched with the command:

./micropython

ArchLinux

The following packages will need to be installed before you can compile and run MicroPython:

  • gcc or gcc-multilib
  • readline
  • git

To install these packages, use the following command:

pacman -S gcc readline git

Then, clone the repository to your local machine:

git clone https://github.com/micropython/micropython.git

Change directory to the Unix build directory:

cd micropython/unix

And then make the executable

make

At that point, you will have a functioning micropython executable, which may be launched with the command:

./micropython

Gentoo Linux

Mac OSX

Dependencies are listed on MicroPython on Mac OSX

The XCode and Command Line Developer Tools package will need to be installed before you can compile and run MicroPython:

xcode-select --install

Then, clone the repository to your local machine:

git clone https://github.com/micropython/micropython.git

Change directory to the Unix build directory:

cd micropython/unix

And then make the executable

make

At that point, you will have a functioning micropython executable, which may be launched with the command:

./micropython

Microcontrollers (Bare-Metal, without an OS)

ARM-based microcontrollers

On a Ubuntu 12.04LTS this worked

sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded sudo apt-get update sudo apt-get install gcc-arm-none-eabi (as of 2015Sept19 pulled in amd64 4.9.3.2015q2-1trusty1)

If needed to remove sudo apt-get remove gcc-arm-none-eabi

Assuming the micropython has been installed in directory cd stmhal make

cd ../teensy sudo apt-get install realpath make (completes) See Running Scripts in https://github.com/micropython/micropython/wiki/Board-Teensy3.1) Discussion on design https://forum.pjrc.com/threads/24794-MicroPython-for-Teensy-3-1/)

cd ../minimal make - FAILS

Clone this wiki locally