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

8
  • I believe apps run with crontab will run as root user. Did you install pandas with sudo?
    – CoderMike
    Aug 5, 2022 at 19:57
  • 1
    ahh no. I just used pip install pandas.
    – Towlie
    Aug 5, 2022 at 19:58
  • 2
    Can't see any Pi relevance to this question.
    – joan
    Aug 5, 2022 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, 2022 at 20:12
  • Try ‘sudo pip3 install pandas’
    – CoderMike
    Aug 5, 2022 at 20:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.