raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
889 stars 188 forks source link

[BUG] AttributeError: module 'kms' has no attribute 'PixelFormat' #1032

Open xedrion opened 6 months ago

xedrion commented 6 months ago

Hello,

Describe the bug I am trying to import the module picamera2 using python 3.9.6 on my raspberry pi4 with Debian 12 OS

Console Output, Screenshots

import picamera2 Traceback (most recent call last): File "", line 1, in File "/home/louis/.local/lib/python3.9/site-packages/picamera2/init.py", line 9, in from .picamera2 import Picamera2, Preview File "/home/louis/.local/lib/python3.9/site-packages/picamera2/picamera2.py", line 28, in from picamera2.previews import DrmPreview, NullPreview, QtGlPreview, QtPreview File "/home/louis/.local/lib/python3.9/site-packages/picamera2/previews/init.py", line 1, in from .drm_preview import DrmPreview File "/home/louis/.local/lib/python3.9/site-packages/picamera2/previews/drm_preview.py", line 48, in class DrmPreview(NullPreview): File "/home/louis/.local/lib/python3.9/site-packages/picamera2/previews/drm_preview.py", line 50, in DrmPreview "RGB888": pykms.PixelFormat.RGB888, AttributeError: module 'kms' has no attribute 'PixelFormat'

Hardware : I am using the Raspberry Pi 4 with the Pi Camera v2.1

davidplowman commented 5 months ago

Are you running a standard Raspberry Pi OS or something else? What happens when you try this:

import pykms
print(pykms.PixelFormat.RGB888)