Installation Instructions

Prerequisites installation

Debian

For < Ubuntu 20.04 you will need to check first if which version your python is on and if you have ‘python3’ on your system.

From a fresh Ubuntu 20.04 system, running the client form source requires git, pip and a lib for the Qt GUI.

sudo apt install git python3-pip libxcb-xinerama0
pip3 install --upgrade pip

Setting udev permissions

Using Crazyradio on Linux requires that you set udev permissions. See the cflib installation guide for more information.

Windows

Install Python3 using the official python build from python.org. Make sure to check the “add to path” checkbox during install. Make sure to check if it works by opening a cmd or powershell terminal:

python --version
pip --version

upgrade pip as well:

pip3 install --upgrade pip.

Install git from the official git website. Make sure it is in PATH as well, which can be checked also with:

git --version

Install crazyradio drivers

To use Crazyradio you will have to install the drivers

Mac

Intel X86

Python3 and required libs can be installed with brew:

brew install python3 libusb
brew link python3   # This makes sure the latest python3 is used
# if "which python3" does not return "/usr/local/bin/python3", relaunch your terminal
pip3 install --upgrade pip.

Apple M1

On Apple M1 Macs, care should be taken to use the X86 version of Brew since not all required dependencies compiles for the native arm64 architecture of the M1 macs. This can be done by using the arch commands when installing brew:

# Installing brew for x86_64, it will be installed in /usr/local by default
arch --x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Now we have to use brew and then python from /usr/local ...
arch --x86_64 brew install python@3.9 libusb
# The arch command is not required anymore since everything brew installed are x86 executables

From there, you can either add /usr/local/bin up in your path variable or run /usr/local/bin/pip3 and /usr/local/bin/python3 instead of pip3 and python3.

Installing from latest release

If you are planning to not do any development on the client itself, we highly recommend you to install the cfclient according to latest release (as according of the instructions described) and not from source (from these instructions).

Make sure that you have installed the prerequisites!

From Pypi (Windows, Mac, Linux, …, with python3)

Each release of the client is pushed to the pypi repository. If you have python >= 3.6, it can be installed with pip:

pip3 install cfclient

Installing from source

If you are planning to do development with the cfclient, you are at right spot! The Crazyflie client requires Python >= 3.6. The following instructions describe hot to install it from source. Make sure to also install the cflib from source as well!

Make sure that you have installed the prerequisites

Pip and Venv

It is good to work within a python venv, this way you are not installing dependencies in your main python instance. For those that prefer it, you could also use Anaconda.

Linux

Clone the repository with git

git clone https://github.com/bitcraze/crazyflie-clients-python
cd crazyflie-clients-python

Installing the client

All other dependencies on linux are handled by pip so to install an editable copy simply run:

$ pip3 install -e .

If you plan to do development on the client you should run:

$ pip3 -e .[dev]

The client can now be runned using cfclient if the local pip bin directory is in the path (it should be in a venv or after a reboot), or with python3 -m cfclient.gui.

At the very least you should never run pip in sudo, this would install dependencies system wide and could cause compatibility problems with already installed application. If the pip of python3 -m pip command request the administrator password, you should run the command with --user (for example python3 -m pip install --user -e .). This should not be required on modern python distribution though since the –user flag seems to be the default behaviour.

Windows (7/8/10)

Assuming git is installed such that you can use it from powershell/cmd, cd to a desired folder and git clone the project:

git clone https://github.com/bitcraze/crazyflie-clients-python
cd crazyflie-clients-python

Install the client from source

pip3 install -e .

or install the client in development mode:

pip install -e .[dev]

You can now run the clients with the following commands:

cfclient
cfheadless
cfloader
cfzmq

Mac OSX

To install the client in edit mode:

pip3 install -e .

The client can now be started with cfclient or python3 -m cfclient.gui.

Extra

Pre commit hooks

If you want some extra help with keeping to the mandated python coding style you can install hooks that verify your style at commit time. This is done by running:

$ pre-commit install

This will run the lint checkers defined in .pre-commit-config-yaml on your proposed changes and alert you if you need to change anything.

Working with the GUI .ui files

you can edit the .ui files for the GUI with QtCreator. For Windows and Mac You can the Qt development kit from the Qt website. On linux QtCreator is usually available as package, for example on Ubuntu it can be installed with sudo apt install qtcreator.