Requirements
This project requires Python 3.10+.
Recommendation: Use a Python virtual environment to isolate dependencies. See the official Python venv documentation for setup instructions.
Platform Prerequisites
Ubuntu/Linux
The Crazyradio is easily recognized on Linux, but you need to set up udev permissions. See the USB permission instructions to configure udev on Ubuntu/Linux.
Note for Ubuntu 20.04 users: Use
pip3
instead ofpip
in all installation commands below.
Windows
Install the Crazyradio drivers using the Zadig instructions.
If you’re using Python 3.13, you need to install Visual Studio. During the installation process, you only need to select the Desktop Development with C++ workload in the Visual Studio Installer.
macOS
For Python 3.12+ on macOS, you need to install libusb using Homebrew:
$ brew install libusb
If your Homebrew installation is in a non-default location, you might need to link the libusb library:
$ export DYLD_LIBRARY_PATH="YOUR_HOMEBREW_PATH/lib:$DYLD_LIBRARY_PATH"
Installation Methods
From PyPI (Recommended)
pip install cflib
From Source (Development)
Clone the repository
git clone https://github.com/bitcraze/crazyflie-lib-python.git
cd crazyflie-lib-python
Install cflib from source
pip install -e .
Uninstall cflib
pip uninstall cflib
Development Tools (Optional)
Pre-commit hooks
If you want help maintaining Python coding standards, you can install hooks that verify your style at commit time:
pip install pre-commit
cd crazyflie-lib-python
pre-commit install
pre-commit run --all-files
This will run the lint checkers defined in .pre-commit-config-yaml
on your proposed changes.
Testing with the Toolbelt
For information and installation of the toolbelt:
- Check to see if you pass tests:
tb test
- Check to see if you pass style guidelines:
tb verify
Note: The toolbelt is an optional way of running tests and reduces the work needed to maintain your Python environment.