Please :ref:`install the necessary dependencies <Supported Platforms>` for your platform by referring to the table below. Once installed you can :ref:`install the DepthAI library <Install from PyPI>`.
We are constantly striving to improve how we release our software to keep up with countless platforms and the numerous ways to package it. If you do not see a particular platform or package format listed below please reach out to us on Discord or on Github.
We keep up-to-date, pre-compiled, libraries for the following platforms. Note that a new change is that for Ubuntu now also work unchanged for the Jetson/Xavier series:
| Platform | Instructions | Tutorial | Support |
|---|---|---|---|
| Windows 10 | :ref:`Platform dependencies <Windows>` | Video tutorial | Discord |
| macOS | :ref:`Platform dependencies <macOS>` | Video tutorial | Discord |
| Ubuntu & Jetson/Xavier | :ref:`Platform dependencies <Ubuntu>` | Video tutorial | Discord |
| Raspberry Pi | :ref:`Platform dependencies <Raspberry Pi>` | Video tutorial | Discord |
And the following platforms are also supported by a combination of the community and Luxonis.
| Platform | Instructions | Support |
|---|---|---|
| Fedora | Discord | |
| Robot Operating System | Discord | |
| Windows 7 | :ref:`WinUSB driver <Windows 7>` | Discord |
| Docker | :ref:`Pull and run official images <Docker>` | Discord |
bash -c "$(curl -fL http://docs.luxonis.com/_static/install_dependencies.sh)"Close and re-open the terminal window after this command.
The script also works on M1 Macs, Homebrew being installed under Rosetta 2, as some Python packages are still missing native M1 support. In case you already have Homebrew installed natively and things don't work, see here for some additional troubleshooting steps.
Note that if the video streaming window does not appear consider running the following:
python3 -m pip install opencv-python --force-reinstall --no-cache-dirSee the Video preview window fails to appear on macOS thread on our forum for more information.
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bashThese Ubuntu instructions also work for the Jetson and Xavier series.
sudo wget -qO- http://docs.luxonis.com/_static/install_dependencies.sh | bashNote! If opencv fails with illegal instruction after installing from PyPi, add:
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
source ~/.bashrcFor openSUSE, available in this official article how to install the OAK device on the openSUSE platform.
We recommend using the Chocolatey package manager to install DepthAI's dependencies on Windows. Chocolatey is very similar to Homebrew for macOS. Alternatively, it is also possible to :ref:`install DepthAI and its dependencies manually <Manually install DepthAI on Windows>`, although it can be more time consuming and error prone.
To install Chocolatey and use it to install DepthAI's dependencies do the following:
- Right click on Start
- Choose Windows PowerShell (Admin) and run the following:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))- Close the PowerShell and then re-open another PowerShell (Admin) by repeating the first two steps.
- Install Python and PyCharm
choco install cmake git python pycharm-community -yAlthough we do not officially support Windows 7, members of the community have
had success manually installing WinUSB using Zadig. After connecting your DepthAI device look for a
device with USB ID: 03E7 2485 and install the WinUSB driver by
selecting WinUSB(v6.1.7600.16385) and then Install WCID Driver.
We maintain a Docker image containing DepthAI, it's dependencies and helpful tools in the luxonis/depthai-library repository on Docker Hub. It builds upon the luxonis/depthai-base image.
Run the 01_rgb_preview.py example inside a Docker container on a Linux host
(with the X11 windowing system):
docker pull luxonis/depthai-library
docker run --rm \
--privileged \
-v /dev/bus/usb:/dev/bus/usb \
--device-cgroup-rule='c 189:* rmw' \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
luxonis/depthai-library:latest \
python3 /depthai-python/examples/01_rgb_preview.pyTo allow the container to update X11 you may need to run xhost local:root on
the host.
Our packages are distributed via PyPi, to install it in your environment use
python3 -m pip install depthaiFor other installation options, see :ref:`other installation options <Other installation methods>`.
We have a set of examples that should help you verify if your setup was correct.
First, clone the depthai-python repository and change directory into this repo:
git clone https://github.com/luxonis/depthai-python.git
cd depthai-pythonNext install the requirements for this repository. Note that we recommend installing the dependencies in a virtual environment, so that they don't interfere with other Python tools/environments on your system.
- For development machines like Mac/Windows/Ubuntu/etc., we recommend the PyCharm IDE, as it automatically makes/manages virtual environments for you, along with a bunch of other benefits. Alternatively,
conda,pipenv, orvirtualenvcould be used directly (and/or with your preferred IDE). - For installations on resource-constrained systems, such as the Raspberry Pi or other small Linux systems, we recommend
conda,pipenv, orvirtualenv. To set up a virtual environment withvirtualenv, runvirtualenv venv && source venv/bin/activate.
Using a virtual environment (or system-wide, if you prefer), run the following to install the requirements for this example repository:
cd examples
python3 -m pip install -r requirements.txtNow, run the 01_rgb_preview.py script from within examples directory to make sure everything is working:
python3 01_rgb_preview.pyIf all goes well a small window video display should appear. And example is shown below:
After you have run this example, you can run other examples to learn about DepthAI possibilities. You can also proceed to:
- Our tutorials, starting with a Hello World tutorial explaining the API usage step by step (:ref:`here <Hello World>`)
- Our experiments, containing implementations of various user use cases on DepthAI (here)
You can also proceed below to learn how to convert your own neural network to run on DepthAI.
And we also have online model training below, which shows you how to train and convert models for DepthAI:
- Online ML Training and model Conversion: HERE
To get the latest and yet unreleased features from our source code, you can go ahead and compile depthai package manually.
- CMake > 3.2.0
- Generation tool (Ninja, make, ...)
- C/C++ compiler
- libusb1 development package
On Debian based systems (Raspberry Pi OS, Ubuntu, ...) these can be acquired by running:
sudo apt-get -y install cmake libusb-1.0-0-dev build-essentialAssuming a stock Mac OS X install, depthai-python library needs following dependencies
Homebrew (If it's not installed already)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"Python,
libusb, CMake,wgetbrew install coreutils python3 cmake libusb wget
And now you're ready to clone the depthai-python from Github and build it for Mac OS X.
Pip allows users to install the packages from specific commits, even if they are not yet released on PyPi.
To do so, use the command below - and be sure to replace the <commit_sha> with the correct commit hash from here
python3 -m pip install git+https://github.com/luxonis/depthai-python.git@<commit_sha>From time to time, it may be of interest to use a specific branch. This may occur, for example,
because we have listened to your feature request and implemented a quick implementation in a branch.
Or it could be to get early access to a feature that is soaking in our develop for stability purposes before being merged into main
(develop is the branch we use to soak new features before merging them into main):
So when working in the depthai-python repository, using a branch can be accomplished with the following commands.
Prior to running the following, you can either clone the repository independently
(for not over-writing any of your local changes) or simply do a git pull first.
git checkout <branch>
git submodule update --init --recursive
python3 setup.py developIf desired, you can also install the package from the source code itself - it will allow you to make the changes to the API and see them live in action.
To do so, first download the repository and then add the package to your python interpreter in development mode
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python
git submodule update --init --recursive
python3 setup.py develop # you may need to add sudo if using system interpreter instead of virtual environmentIf you want to use other branch (e.g. develop) than default (main), you can do so by typing
git checkout develop # replace the "develop" with a desired branch name
git submodule update --recursive
python3 setup.py developOr, if you want to checkout a specific commit, type
git checkout <commit_sha>
git submodule update --recursive
python3 setup.py develop