I am trying to run a python file on bootup which will collect some data from another device.
I created a service in the /etc/systemd/system directory
[Unit]
Description = File which requests data from Device
After = multi-user.target
[Service]
Type = simple
ExecStart = /usr/bin/python3 /home/user/file1.py
Restart = always
StartLimitInterval = 60
StartLimitBurst = 10
[Install]
WantedBy = multi-user.target
however I get the following error when examining why service didn’t start
ModuleNotFoundError: No module named 'pyModbusTCP'
Based on some other solution I found online it was suggested to remove the package from the user and instead install it in the root directory. So I uninstalled it and installed it via
sudo pip3 install pyModbusTCP
However it is still the same error. Must I point to the library in the service setup file? Thank you!