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

Open
#1,032 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, raspberry-pi
Domain
embedded-iot

Research direction

Start with the import traceback and inspect picamera2/previews/drm_preview.py, especially the DrmPreview references to pykms.PixelFormat. Reproduce the import on Raspberry Pi with Python 3.9 and Debian 12, then verify that the package imports successfully without the AttributeError.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
1.2k
Forks
258
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picamera2

All issues in raspberrypi/picamera2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.