I’m not a Python guy, but I imagine it has something similar to a linker for module path search. So I ran this command:
python3.6 --help | less -i
Inside of this it does describe some environment variables which are probably not set up when running via
systemd, but part of a user environment in other cases. In that help page I can search for “module” via:
less -i” says the pager will perform case-insensitive searches)
This is the part which sticks out, and you might be able to prefix your command with the environment variables in the script:
PYTHONPATH : ':'-separated list of directories prefixed to the
default module search path. The result is sys.path.
PYTHONHOME : alternate <prefix> directory (or <prefix>:<exec_prefix>).
The default module search path uses <prefix>/lib/pythonX.X.
This is your original
Don’t know if this will work (I’m mainly a C/C++ coder), but you might try prefixing the command with something like this (but name the path and file based on the module it needs…experimenting likely required):
ExecStart=PYTHONPATH=/some/where/module_name.py /usr/bin/python3.6 /home/znvidia/Desktop/Drowsiness_detection.py