I am trying to get a simple script to run on start-up of debian Raspberry Pi where
startupTest.py writes the time of run to a .txt file
$python3 /home/pi/startupTest.py 
runs successfully in command line
$ python /home/pi/startupTest.py 
runs successfully in command line
However using
$ sudo crontab -e  to write
@reboot python3 /home/pi/startupTest.py &
Yields
bash: alias: python: not found
bash: alias: /usr/local/bin/python3.8: not found
bash: alias: python: not found
bash: alias: /usr/local/bin/python3.8: not found
bash: alias: python: not found
bash: alias: /usr/local/bin/python3.8: not found
Okay, am I missing python3.8 in that directory? no
$ ls /usr/local/bin shows python3.8
I am a Mechanical Engineering student trying to get a testing system working for my senior design project.
The problems is when running sudo crontab -e actually that root user runs the script. If in your startupTest.py you do not have any special code that might need sudo privilege, just remove sudo and add your command in crontab -e startup  list.
Bash alias not found during start-up on raspberry pi