0

I have a program in python 3.7 that imports and uses smbus2 on Pi B+. If the program is run from the terminal or from Thonny 3.2, it works fine. If I configure it to run from rc.local or crontab on boot, it can't find the smbus2 module. Other programs work ok on boot from rc.local or crontab that don't use smbus2.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
chris
  • 1
  • Look at the user the script is running as and the permission that user has. – Stephen Rauch Feb 04 '20 at 03:20
  • 1
    Does this answer your question? [CronJob not running](https://stackoverflow.com/questions/22743548/cronjob-not-running) – Stephen Rauch Feb 04 '20 at 03:21
  • [Python script in rc.local is not running and log file is not updated](https://raspberrypi.stackexchange.com/questions/75703/python-script-in-rc-local-is-not-running-and-log-file-is-not-updated) by this link, usually path and permission can occur this problem on rc.local. Use full path and also check that root permission can execute your command. – Yoon-Geun Kwon Feb 04 '20 at 03:43
  • The problem was smbus2 wasn't installed globally. reinstalled using "sudo pip3 install smbus2". Spent hours trying to get to work so thank you very much! – chris Feb 04 '20 at 14:14

0 Answers0