Question: I am currently running Raspberry pi 6 4 - bit OS ( bookworm ) . I am trying to make the raspberry pi camera to

I am currently running Raspberry pi 64-bit OS (bookworm). I am trying to make the raspberry pi camera to work using pycharms with python language. Please take note that the old picamera doesn't seem to work on the latest versions of Raspberry pi which is why I'm using picamera2. A lot of changes has happened with the new versions of raspbery pi
Please help me fix this error. I hope this can be fixed within pycharm since I'm working a project in it.
These are the commands I use to install the dependencies (I have used the virtual environment within Pycharms):
sudo apt full-upgrade
sudo reboot
sudo apt-get install libcamera-dev
pip install --upgrade pip setuptools wheel
pip install picamera2
pip install rpi-libcamera
The code:
from picamera2 import Picamera2
picam2= Picamera2()
The Error:
Traceback (most recent call last):
File "/home/pi/pycharmProject1/test/.venv/lib/python3.11/site-packages/picamera2/previews/drm_preview.py", line 9, in
import kms as pykms
ModuleNotFoundError: No module named 'kms'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/pycharmProject1/test/main.py", line 1, in
from picamera2 import Picamera2
File "/home/pi/pycharmProject1/test/.venv/lib/python3.11/site-packages/picamera2/__init__.py", line 9, in
from .picamera2 import Picamera2, Preview
File "/home/pi/pycharmProject1/test/.venv/lib/python3.11/site-packages/picamera2/picamera2.py", line 28, in
from picamera2.previews import DrmPreview, NullPreview, QtGlPreview, QtPreview
File "/home/pi/pycharmProject1/test/.venv/lib/python3.11/site-packages/picamera2/previews/__init__.py", line 1, in
from .drm_preview import DrmPreview
File "/home/pi/pycharmProject1/test/.venv/lib/python3.11/site-packages/picamera2/previews/drm_preview.py", line 11, in
import pykms
ModuleNotFoundError: No module named 'pykms'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!