{"id":21784,"library":"pypylon","title":"pypylon","description":"The official Python wrapper for the Basler pylon Camera Software Suite, enabling control of Basler cameras via Python. Current version is 26.3.1, released around April 2026. The library follows Basler's pylon release cadence, with major version bumps aligning with pylon SDK updates.","status":"active","version":"26.3.1","language":"python","source_language":"en","source_url":"https://github.com/basler/pypylon","tags":["basler","camera","vision","industrial","pylon"],"install":[{"cmd":"pip install pypylon","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"pypylon is a namespace package; cameras are accessed via pylon module.","wrong":"import pypylon","symbol":"InstantCamera","correct":"from pypylon import pylon"},{"note":"Direct import from pypylon.pylon may break; use pylon.PylonImage.","wrong":"from pypylon.pylon import PylonImage","symbol":"PylonImage","correct":"from pypylon import pylon"}],"quickstart":{"code":"from pypylon import pylon\n\n# Enumerate cameras\ndevices = pylon.TlFactory.GetInstance().EnumerateDevices()\ncamera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())\ncamera.Open()\nprint(\"Camera model:\", camera.GetDeviceInfo().GetModelName())\ncamera.StartGrabbing(1)\ngrab = camera.RetrieveResult(5000)\nif grab.GrabSucceeded():\n    img = grab.Array\n    print(\"Image shape:\", img.shape)\ncamera.Close()","lang":"python","description":"Basic camera enumeration, opening, grabbing one image, and closing."},"warnings":[{"fix":"Use pypylon 26.x with pylon SDK >=6.3. Check Basler's compatibility matrix.","message":"pypylon 26.x drops support for Python 3.8 and older; requires pylon SDK 6.x or later. Older 4.x versions are incompatible with newer pylon SDKs.","severity":"breaking","affected_versions":"<=4.2.0 vs >=26.0.0"},{"fix":"Always use 'from pypylon import pylon' or 'import pypylon.pylon as pylon'.","message":"The pypylon package name changed from 'pypylon' to 'pypylon' but the import module is 'pylon' (not 'pypylon'). Common mistake: 'import pypylon' fails because pypylon is a namespace package without a top-level module.","severity":"breaking","affected_versions":"All"},{"fix":"Download and install the pylon SDK for Linux from Basler's support site before pip installing pypylon.","message":"On Linux, the pylon SDK must be installed separately (via Basler's website) because pypylon depends on system-wide pylon libraries. pip install does not include them.","severity":"gotcha","affected_versions":"All"},{"fix":"Use: with camera.RetrieveResult(5000) as grab: ...","message":"PylonImage objects returned by RetrieveResult() must be released to avoid memory leaks. Use 'with' context manager or call Release() manually.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install pypylon","cause":"pypylon not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'pypylon'"},{"fix":"Ensure pylon SDK is installed (check with 'pylon-config --version' on Linux) and camera is connected via USB/GigE.","cause":"pylon SDK not properly installed or camera not connected.","error":"pypylon.pylon.PylonException: The pylon transport layer is not available. (Timeout)"},{"fix":"Install the pylon SDK from Basler, then set LD_LIBRARY_PATH to the pylon lib directory, e.g., export LD_LIBRARY_PATH=/opt/pylon/lib64:$LD_LIBRARY_PATH","cause":"Missing pylon SDK system libraries on Linux.","error":"ImportError: libpylonbase-6.3.so: cannot open shared object file: No such file or directory"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}