Python script.py

April 29, 2024, 16:23

davidek_12

Python script.py, when I put raspberripi in the terminal it doesn't want to run the script. I use raspberrypi 4 model B, and camera module 3 via ssh mode mobaxterm

thunder07337

Where did you get the idea to start the script with "raspberrypi"?

davidek_12

<@1187039958561726494> this is my school assignment: to describe target space monitoring and occupancy detection using the Raspberry Pi platform. The resulting hardware product will provide and display to the user the monitored space and detected persons

davidek_12

<@796000224690307072> I have raspberry pi 4 model B, camera module 3 via SSH mode mobaxterm. My task is to do person detection, not recognition. I have the program but when I want to run it I get an error (see photo)

oops.se

Please post text as text

thunder07337

In the last line he says what the problem is. A file or directory is missing.

oops.se

And don't ping me, just reply!

davidek_12

okej, sorry for ping

davidek_12

I don't know what to do with this error when it's writing me out. How do I fix the error ?

thunder07337

i'm not that familiar with python. but google will help you, just enter the error exactly as it appears in the search.

davidek_12

I'm trying to run it in Visual studio code. I get this error. (see photo)

thunder07337

Try
python3
Otherwise search, search, search... I'm not familiar with Python, but it tell you what's missing.

davidek_12

okay, i will try it, thanks.

davidek_12

I tried it, and it still doesn't work.

davidek_12

I've searched and searched, I've tried chatgpt4, and I still can't figure it out. Maybe I'm doing something wrong?

davidek_12


kutuptilkisi

dont use libcamera

kutuptilkisi

use opencv

kutuptilkisi

not sure what you are tying to do but looks like there is no libcamera installed on your rpi

kutuptilkisi

or maybe try
pip install libcamera -U

davidek_12

okey, i will try it

kutuptilkisi

<@490921683549421569> are you using rpi os or something else?

davidek_12


davidek_12

Raspberry Pi 4 model B

kutuptilkisi

no operating system

davidek_12


kutuptilkisi

can you try using sudo raspi-config

kutuptilkisi

is it a valid command?

davidek_12

yes

davidek_12

and what should I do after this command?

kutuptilkisi

okay execute the command, go to "Interface Options" and select "Legacy Camera Support" and enable it (if not already enabled) by pressing enter. Say Yes, Finish and reboot

kutuptilkisi

might be related to this

davidek_12

okay, I'll try it, I'll get back to you

kutuptilkisi

If it still doesn't work

kutuptilkisi

sudo apt install -y python3-libcamera python3-kms++

kutuptilkisi

this should install missing pieces of library

davidek_12

when i go to interface options, i dont have "Legacy Camera Support"

kutuptilkisi

hmmm, they might have deleted that. Just go back and close

kutuptilkisi

Try this

davidek_12

still the same problem

kutuptilkisi

are you using a virtual env in your project?

davidek_12

yes

kutuptilkisi

looks like lib camera needs special install for venv.
sudo apt install -y libcamera-dev
pip install rpi-libcamera

kutuptilkisi

if this doesn't work idk what else it needs

davidek_12

i will try it

davidek_12

still the same problem..

davidek_12

thank you for your help today, I'll get back to you tomorrow

kutuptilkisi

the only thing i found in internet is this

kutuptilkisi

maybe try this

davidek_12

thank you so much, i try it tommorow and send you feedback

davidek_12

Hello, I managed to get the camera working. Now I would need help on how to script the person detection.