Forums

Getting no such file or directory error when trying to run an always on task even though the directory is correct

As the title says, i am putting in what it says and it gives out the no such file or directory error. here is what it says: (date) bash: home/sonicj/basedbot.py: No such file or directory

update: i added a / before home and now i get this message /home/sonicj/basedbot.py: Permission denied

ok i did some stuff and now its giving me

Jul  7 21:28:10 import: unable to open X server `' @ error/import.c/ImportImageCommand/364.
Jul  7 21:28:10 /home/sonicj/basedbot.py: line 2: syntax error near unexpected token `('
Jul  7 21:28:10 /home/sonicj/basedbot.py: line 2: `client=discord.Client()'

[edit by admin: formatting]

It sounds like you're trying to run your code as a Bash script, but it's actually a Python script. For an always on task, you should specify a Bash command that you want to run, so to run a Python script you should give a command like this:

python3.8 /home/sonicj/basedbot.py

Hi Giles. This is probably a dumb question but using your example, what is an easy way to find out which python version im using?

Hi @jclifford442 -- in Bash console use python --version command, in a script: import sys; print(sys.version). If you are not using a virtualenv, by default tasks will use Python 2.7 because this is still default Python version in Ubuntu we're using.