Question: I need to use a raspberry pi camera in my project but I always failed installing it due to errors. I am currently using pycharms

I need to use a raspberry pi camera in my project but I always failed installing it due to errors. I am currently using pycharms but installing the package in it always gives me an error. Please take note that I am currently using 64-bit Raspberry pi OS Bookworm version so the old picamera version is not compatible with it anymore.
It seems that I have to install rpi Libcamera but using the command didnt do the trick
I used the command below but it I'm still having import picamera2 error when using pycharm python.
(.venv)pi@raspberrypi: sudo apt-get install libcamera-apps
Also, I have used this command as well in order:
pip uninstall picamera2 rpi-libcamera
sudo apt update && sudo apt upgrade
pip cache purge
pip install picamera2 rpi-libcamera
However using pip install picamera2 rpi-libcamera command makes the entire of the raspberry pi screen freeze up. It specifically freezes at preparing metadata(pyproject.toml)... I am not sure if it is just taking a while to compile but I say that it freezes because I can not even move the mouse cursor of it.
What is the proper way to install picamera2in raspberry pi 4 so that I can use the raspberry pi camera to Pycharms Python project?

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!