from pypylon import pylon
with pylon.InstantCamera(pylon.FirstFound) as camera:
    grab_result = camera.GrabOne(5000)
    pylon.DisplayImage(1, grab_result)
Software

pypylon

Official Python wrapper for Basler vision hardware

pypylon is a Python interface in the pylon Software Suite that integrates Basler vision components with Python. As an official Basler product, you benefit from reliable support directly from our experts. Python offers you maximum flexibility through its open-source code, enabling pypylon to be customized to meet your needs.

pip install pypylon
  • Reliability and technical support

    pypylon remains 100% open source, but is developed, delivered, and supported by our technical support team.
  • A simple introduction to pypylon

    Over 50 code examples, including comprehensive documentation and a getting-started guide, make it easy to get started in pypylon.
  • Full feature set in pypylon

    Every feature of the pylon SDK is also available in pypylon, including camera configuration and image processing
  • From prototype to robust solution in no time

    With Python and pypylon, you can effortlessly turn ideas into powerful solutions—with the robustness and speed of the pylon SDK
pypylon Documentation

pypylon documentation and tutorials

In the Basler documentation, you'll find helpful information on installation, usage, and basic programming examples using Basler vision hardware.

pypylon makes getting started with Basler products easier than ever. If you write Python, you can capture your first image in just a few lines—without having to use C++ or set up a new toolchain. Since both are based on the same pylon technology, solutions can be tested quickly and deployed into production reliably.
Lennart von Werder
Lennart von Werder
Product Manager

That's why pypylon is worth it

Python is one of the most widely used programming languages in the world—easy to learn, with concise syntax and one of the largest open-source ecosystems for image processing, data analysis, and test automation.

pypylon combines these advantages with the powerful features of the Basler pylon Software Suite. Both new and experienced Python developers can create prototypes and image processing functions and test Basler cameras—without the need for a complex development environment. This speeds up evaluation, increases productivity, and reduces project costs.

⭐ 700+ stars on GitHub

⬇️ 80,000+ downloads

🔄 Monthly Releases
from pypylon import pylon

with pylon.InstantCamera(pylon.FirstFound) as camera:
    print("Using device:", camera.DeviceInfo.ModelName)
    camera.Width.TrySetToMaximum()
    camera.StartGrabbingMax(100)
    while camera.IsGrabbing():
        with camera.RetrieveResult(
            5000, pylon.TimeoutHandling_ThrowException
        ) as grab_result:
            if grab_result.GrabSucceeded():
                with grab_result.GetFirstImageDataComponent() as image_data_component:
                        img = image_data_component.Array
                        print(f"SizeX: {image_data_component.Width};"
                              f"SizeY: {image_data_component.Height}; "
                              f"Gray value of first pixel: {img[0, 0]}")

The first picture will be posted in a few minutes.

The pypylon API is designed for Python developers—not as a C++ wrapper that’s translated later, but with Python-like syntax, descriptive method names, and full IDE auto-completion. With just a few lines of code and no complex development environment required, you can connect your camera, set parameters, and start streaming your first images. Despite the simple syntax, the full range of features of the pylon C++ SDK is available—from basic image capture to multi-camera setups, events, and chunk data.

In our
webinar, we’ll explain how you can use pypylon.

Basler pylon vTools

pypylon & vTools - It's a match! 

pylon’s vTools for high-performance image processing can also be used via the pypylon interface, allowing Python users to reduce development time. With the ability to create image processing pipelines in the pylon Viewer and precisely adapt them to a live image, you'll be able to flexibly integrate everything you need into your application. 

To the pylon vTools

Ready-to-use examples

Whether it's your first test setup or a complex multi-camera application, our code examples cover the most important use cases—ready for immediate use or as a foundation for your own projects.

View all samples
Acquisition

Continuous image stream

Continuous image capture with configurable exposure, gain, and pixel format. Includes NumPy array output.

grab.py
Integration

OpenCV live
preview

Live camera feed displayed directly via cv2.imshow. The built-in converter converts Bayer and mono formats for OpenCV.

opencv.py
Advanced

Multi-camera synchronization

Synchronous image capture from multiple cameras through InstantCameraArray, using hardware or software triggers.

grab_multiple_cameras.py
Events

Camera event handler

Registering Python callbacks for camera events—demonstrated using the Exposure-End event, including frame ID and timestamp.

grab_camera_events.py
Chunk Data

Timestamp & metadata

Access to chunk data per frame, including the hardware timestamp, exposure time, and other camera status information.

grabchunkimage.py
Workflow

Debugging

Reads device information and camera parameters—to test features, transport layers, and interfaces.

info_dumper.py

Using pypylon in practice

pypylon is used wherever Python's well-known flexibility meets industrial image processing—from quality inspection on the production floor to the research lab, and from the first prototype to production-ready applications.

Vision technology for food and bottle inspection

Quality control & inspection

Image processing pipelines for defect detection, measurement, and completeness verification—with direct access to camera features such as triggers and chunk data.
Whether for optimizing sorting and picking processes, or for reducing times for storage and retrieval processes: Basler Vision Solutions for warehouse automation offer a wide range of possible applications.

Robotics & automation

Camera-based navigation, object recognition, and pallet identification for autonomous systems— also compatible with ARM-based edge platforms.
Image analysis with classical algorithms or AI

Machine learning & AI training

Fast integration of camera images with popular ML frameworks via NumPy arrays—ideal for training data acquisition and live inference.
Embedded vision systems

Development & prototyping

Quickly set up test environments in Jupyter Notebooks without a complex development environment—for rapid iteration in teaching and research.

Further information about pypylon

Learn more about our products and applications. Our comprehensive materials provide you with all the important details.

FAQ: Answers about pypylon

pypylon covers the full range of features offered by the pylon C++ SDK and is officially developed and supported by our team. It is best suited for both rapid prototyping and use in production applications.

Yes. Multiple cameras can be controlled simultaneously, including individual configuration, synchronization, and parallel image capture via threading.

pypylon supports all common Basler camera interfaces, including GigE Vision and USB3 Vision. The complete list of compatible devices can be found in the documentation.

pypylon is available for Windows, Linux, and macOS. This allows pypylon to be used flexibly in a variety of development and production environments, from a local Windows workstation to a Linux-based embedded system.

  • Windows 64-bit,

  • Linux x86_64 and Linux ARM 64-bit,

  • macOS Intel/ARM 64-bit

The API remains compatible. pypylon is now officially maintained, tested, and distributed by Basler, and technical support is provided—upgrading to the latest version is recommended.

Version compatibility at a glance

Since pypylon 26.1.0, the version number is aligned with the pylon Camera Software Suite. New versions are released monthly in parallel.

pypylon Version

pylon Camera Software Suite

Date

Year.Month

Year.Month

monthly

26.05

26.05

May 2026

26.01

26.01

January 2026

4.2.0

8.1.0

June 2025

4.0.0

7.5

July 2024

3.0.0

7.4

November 2023

*The table is not complete. You can find the full release notes in the documentation.

Important notes:

  • From pypylon 4.0.0: support for Basler 3D cameras (e.g., Basler ToF Camera) and CXP-12

  • From pypylon 3.0.0: support for pylon vTools

  • Supported Python versions: currently up to Python 3.13, also backward compatible from Python 3.9 via ABI3 wheels

Yes. pypylon is fully open source under the BSD license and can be used without restriction in commercial projects.

After installing with `pip install pypylon`, the camera is accessed via an InstantCamera object. The `Open()` method establishes the connection, and `GrabOne()`, `StartGrabbing()`, and `RetrieveResult()` can be used to capture a single image. To the Getting Started Guide

Yes, pypylon is licensed under the BSD license and is available on GitHub. The wrapper itself is open source, but it is based on the pylon Software Suite, which can be installed separately.

How can we support you?

We will be happy to advise you on product selection and find the right solution for your application.