Quantcast
Viewing all articles
Browse latest Browse all 4971

Troubleshooting • Picamera2 ModuleNotFoundError

I was recently trying to use the picamera2 library for a python project but when I try to run the program it shows the following error

Code:

    Traceback (most recent call last):  File "/home/litrobo/Desktop/litdet/test.py", line 1, in <module>    from picamera2 import Picamera2, PreviewModuleNotFoundError: No module named 'picamera2'
I tried installing picamera2 again and it showed

Code:

sudo apt install -y python3-picamera2Reading package lists... DoneBuilding dependency tree... DoneReading state information... Donepython3-picamera2 is already the newest version (0.3.17-1).0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The program was run inside a virtual environment. Could this be a problem with wrongly naming the module, my program was an example program from the picamera2 library documentation.

Code:

from picamera2 import Picamera2, Previewimport timepicam2 = Picamera2()camera_config = picam2.create_preview_configuration()picam2.configure(camera_config)picam2.start_preview(Preview.QTGL)picam2.start()time.sleep(2)picam2.capture_file("test.jpg")

Statistics: Posted by fayisrazal — Tue Apr 09, 2024 2:11 pm



Viewing all articles
Browse latest Browse all 4971

Trending Articles