raspberrypi / picamera2

New libcamera based python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

xedrion opened this issue · comments

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

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

import pykms
print(pykms.PixelFormat.RGB888)