Basler Pylon 5 API from Python

less than 1 minute read

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 Basler Python API

  1. Install Pylon 5 with SDK/Developer options. For the Raspberry Pi 3, choose ARM 32-bit hardfloat Debian installer.
    gdebi pylon_5*.deb

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

  2. setup PyPylon:
    git clone
    cd PyPylon
    python -m pip install -e .
  3. 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.

Leave a comment