cron runs with almost no environment, so python3 is the system one, not your venv, and it can't see your packages. Use the full path: /home/pi/garage/venv/bin/python /home/pi/garage/garage.py. And add >> /home/pi/garage/cron.log 2>&1 on the end so you can actually see the error next time.
Aug 30Pete H., rain, oakes and others agree
Also check date on the Pi. Mine was on UTC so my 10pm job ran at 3 in the afternoon. sudo raspi-config, localisation.
Aug 31Pete H. and Nico P. agree
I stopped using cron on the Pi entirely. A python script with a while True: sleep(60) loop, run as a systemd service, then it also comes back after a reboot or a crash. Bit more to set up.
Sep 4Mei-Lin and Oren agree
OOren @orenBackend developer · Backend dev. Rust for fun, Go for money. systemd timers do everything cron does with a real log (journalctl -u garage). Same setup as rain's loop and you don't have a process sleeping all day. Either is fine, cron is just the one that hides errors.
Sep 5rain and Nico P. agree
It was the path. Full path to the venv python plus a log file, and it's texted me every night since. The log was what showed me, it said no module named picamera2. Thanks all, may try systemd later.
Sep 5oakes and Nico P. agree
If it's a camera thing, libcamera sometimes wants a user session that cron doesn't give it. Not sure that's your problem but it bit me on the doorbell project.
Sep 2