0

I follow this blog to the t to start a python script on startup. (Rasperi pi4B OS 64bit)

my launcher.sh works fine she trying sh launcher.sh

the file looks like:

cd /home/pi/Documents
PYTHONPATH=/home/pi/.local/lib/python3.9/site-packages
python3 /home/pi/Documents/RaspberryPi_ACC.py 

however using it with crontab -e

@reboot sh /home/pi/Documents/launcher.sh >/home/pi/logs/cronlog 2>&1

it just does not work (tried in different configurations) I get always the error

File "/home/pi/Documents/RaspberryPi_ACC.py", line 12, in import pandas as pd ModuleNotFoundError: No module named 'pandas'

pandas is installed, and as I mentioned above, trying with sh launcher.sh does launch without a problem.

I am clueless. Thanks

New contributor
Towlie is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
8
  • I believe apps run with crontab will run as root user. Did you install pandas with sudo?
    – CoderMike
    Aug 5 at 19:57
  • 1
    ahh no. I just used pip install pandas.
    – Towlie
    Aug 5 at 19:58
  • 2
    Can't see any Pi relevance to this question.
    – joan
    Aug 5 at 20:08
  • yes, I now noticed that it might be more of an Ubuntu crontab problem. But I guess/hope a lot of users are also knowledgable in Ubuntu?
    – Towlie
    Aug 5 at 20:12
  • Try ‘sudo pip3 install pandas’
    – CoderMike
    Aug 5 at 20:13

0

Your Answer

Towlie is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.