Basler Pylon 5 API from Python

You can control Basler cameras from Python using the Pylon 5 API via Cython with this procedure for Linux, Mac, and Windows. The Raspberry Pi and some other ARM systems are also covered by Basler camera drivers. PyPylon (the Python Basler interface) is Python 2.7 and Python 3 compatible.


Install Pylon 5 with SDK/Developer options. For the Raspberry Pi, choose ARM 32-bit hardfloat Debian installer as despite the 64-bit processor, the OS is 32-bit.

gdebi pylon_5*.deb

This puts icons in your Linux menu under “Sound & Video/pylon Viewer” and “other/pylon IP Configurator”.

Setup PyPylon:

git clone
cd PyPylon
python -m pip install -e .

Checkout PyPylon example scripts

Live preview

ARM and x86 Linux: run Basler Pylon GUI live viewer:



Fix error

ImportError: PyPylon/pypylon/cython/ undefined symbol: _ZTINSt8ios_base7failureB5cxx11E

conda install libgcc

RuntimeError: Payload data has been discarded. Payload data can be discarded by the camera device if the available bandwidth is insufficient.

Basler claims root is needed but that didn’t solve it for me on an x64 Linux laptop. RichardLangFromNZ fork of PyPylon didn’t help either.

The PyPylon Python Basler API is used extensively by the Open Source Cytometry Project.