Setup and Using MicroPython for Beginners

Pages
Contributors: Christo-boots with the-pher, Member #1919784

SBC Python Installation

You can install the qwiic_i2c_py package to get Qwiic I2C support for your board. Also check out our comprehensive qwiic_py repository.

The qwiic_i2c_py package is primarily installed using the pip3 command, downloading the package from the Python Index - "PyPi".

First, setup a virtual environment from a specific directory using venv:

python3 -m venv ~/sparkfun_venv

You can pass any path instead of ~/sparkfun_venv, just make sure you use the same one for all future steps. For more information on venv click here.

Next, install the qwiic package with:

~/sparkfun_venv/bin/pip3 install sparkfun-qwiic-i2c

Now you should be able to run any example or custom python scripts that have import qwiic_i2c by running e.g.:

~/sparkfun_venv/bin/python3 example_script.py

To get started with any of the Qwiic Drivers, check out our list of Qwiic Python Driver Repos below and follow the device-specific "PyPi Installation" instructions in your device's repository.

As an alternative to pip, at you could also manually clone/download the qwiic_i2c_py repository and the repository for your desired driver and then utilize the qwiic files directly.