Python 2 is now deprecated and libusb works well on Mac OS. In addition Fantom driver will not run on the new OS versions as this is a 32 bit driver. As a result pyfantom is no longer maintained.


Pyfantom is a Python wrapper for the LEGO Mindstorms Fantom Driver. The Fantom Driver is available for Mac OSX and Windows, from LEGO website.

Pyfantom exposes the routines for interfacing to the LEGO Mindstorms NXT using python applications.

The Fantom API is documented in the Fantom SDK 1.0.x available from the same site as the LEGO Fantom Drivers.

Requirements (Mac OSX)

  • Python 2.6.x (Mac OSX default), or Python 2.7 Universal Build (MacPorts)
  • LEGO Mindstorms Fantom Drivers

Requirements (Windows)

[TBD, not tested yet]

  • Python >= 2.6
  • LEGO Mindstorms Fantom Drivers

Get sources

You can clone the git repository with:

git clone

Alternatively, you can download a snapshot and extract it on your computer.

You can also browse source online using cgit.


If you're installing using the source package, first extract the source package, then:

# python install

inside the package directory. This should be run as root (or use sudo).


  • The USB interface is working well.
  • Bluetooth Interface partially works, e.g., send_direct_command(), but raw commands requiring replies sent using NXT.write() fails since does not return any data.
  • Not all Fantom API functions are exposed, e.g., high level iFile, iModule APIs (Patches are welcome).


Please use the mindboards forum to ask for help, or use email addresses from the AUTHORS file.

How to use this wiki?

This wiki is powered by ikiwiki.

You are encouraged to make changes, you just have to register or login using an already existing OpenID compatible account.

All wikis are supposed to have a SandBox, so this one does too.

LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this site.