Have Python 3 Installed

We assume you already have Python 3 installed on your computer. Note we do not support Python 2 - it's deprecated and no longer supported!

At your command line prompt of choice, check your Python version with python --version

Install hidapi

From the command line, manually install hidapi with

pip3 install hidapi

If the install fails with text that ends with something like:

distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

then you will need to also install the Microsoft Visual C++ Build Tools. Thanks to @jklem for pointing this out in the forums.

Download it from here (same link as in text):

NOTE: You do not need the full Visual Studio IDE. Just the Build Tools.

  • Scroll down to where it says Tools for Visual Studio 2019.
  • Expand the list to show the sub options.
  • Click the Download button for Build Tools for Visual Studio 2019.

This downloads a .exe file with a name like vs_BuildTools.exe. Run that to install the build tools and then try the pip install again.

Install Blinka

To install Blinka and its dependencies, run:

pip3 install adafruit-blinka

Set Environment Variable

You must do this every time before running circuitpython code, you can set it permanently in windows if you like, for now just type into the same cmd window you're using with Python

set BLINKA_MCP2221=1

If you are using Windows Powershell, the syntax is a little different. In that case do:

$env:BLINKA_MCP2221=1

NOTE - by default, the terminal window in VSCode uses Powershell.

Check Platform was detected

In the same command window you set BLINKA_MCP2221=1 env var, run python and run

import board
dir(board)

at the Python REPL. If you get no errors, and you see a list of all the pins available - you're good to go!

This guide was first published on Dec 22, 2019. It was last updated on Mar 08, 2024.

This page (Windows) was last updated on Mar 08, 2024.

Text editor powered by tinymce.