What error (systemd does not start the python script)?

In /etc/systemd/system put file vkbot.service , see below.
[Unit]
Description=VK_BOT
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/vkbot/bot.py
Restart=always

[Install]
WantedBy=multi-user.target


Then in the console (PuTTy) enter the following commands.
- systemctl daemon-reload

- systemctl enable vkbot.service
answer :
Created symlink /etc/systemd/system/multi-user.target.wants/vkbot.service → /etc/systemd/system/vkbot.service


- systemctl start vkbot

- systemctl status vkbot
answer :
● vkbot.service - VK_BOT
 Loaded: loaded (/etc/systemd/system/vkbot.service; enabled; vendor preset: enabled)
 Active: failed (Result: exit-code) since Sun 2019-12-01 10:58:21 UTC; 17s ago
 Process: 32463 ExecStart=/usr/local/bin/vkbot/bot.py (code=exited, status=203/EXEC)
 Main PID: 32463 (code=exited, status=203/EXEC)

Dec 01 10:58:21 ithater systemd[1]: Started VK_BOT.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job restart counter is at 5.
Dec 01 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 01 10:58:21 ithater systemd[1]: Failed to start VK_BOT.


In ../var/log file syslog the following information:
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job restart counter is at 4.
Dec 1 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 1 10:58:21 ithater systemd[1]: Started VK_BOT.
Dec 1 10:58:21 ithater systemd[32463]: vkbot.service: Failed to execute command: No such file or directory
Dec 1 10:58:21 ithater systemd[32463]: vkbot.service: Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: No such file or directory
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job restart counter is at 5.
Dec 1 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 10:58:21 ithater systemd[1]: Failed to start VK_BOT.


Of 5 string see
Failed to execute command: No such file or directory

But the file is there.
Here it is:
5de39ed57164e339084099.png

What is the problem?)

PS OS is Ubuntu 18.04
April 2nd 20 at 17:06
2 answers
April 2nd 20 at 17:08
Solution
/usr/local/bin/vkbot/bot.py and ../usr/local/bin/vkbot/bot.py is in General case different ways. you should make sure that in your case they are identical (or not identical, and fix this thing).
what does the command ls-l /usr/local/bin/vkbot/typed in the terminal?
root@ithater:~# ls-l /usr/local/bin/vkbot/
ls: cannot access '/usr/local/bin/vkbot/': No such file or directory - finn.Bosco commented on April 2nd 20 at 17:11
With points the path is displayed in the file Manager VPS provider.
In FileZilla for example is displayed without the dots. 5de3a59f0735d443170822.jpeg - finn.Bosco commented on April 2nd 20 at 17:14
@finn.Bosco, well, rise to the level above and see the output of ls-l /usr/local/bin/ - jacinto_Hartmann commented on April 2nd 20 at 17:17
@jacinto_Hartmann,
root@ithater:~# ls-l /usr/local/bin/
total 860
-rwxr-xr-x 1 root root 558000 27 Apr 2019 rar
-rwxr-xr-x 1 root root 311416 27 Apr 2019 unrar
drwx------ 2 root root 4096 Dec 1 10:50 'vkbot '

Is it me or in the folder vkbot is an empty symbol? - finn.Bosco commented on April 2nd 20 at 17:20
@finn.Bosco, Yes, there was an empty symbol, it was removed.
root@ithater:~# ls-l /usr/local/bin/vkbot/
total 32
-rw-r--r-- 1 root root 7039 Dec 1 10:48 bot.py
-rw-r--r-- 1 root root 1285 Dec 1 10:48 find_using_keys.py
-rw-r--r-- 1 root root 424 Dec 1 10:48 news.py
-rw-r--r-- 1 root root 1053 Dec 1 10:48 notice.py
-rw-r--r-- 1 root root 2784 Dec 1 10:48 parsing.py
-rw-r--r-- 1 root root 1974 Dec 1 10:48 test.py
-rw-r--r-- 1 root root 584 Dec 1 10:48 weather.py - finn.Bosco commented on April 2nd 20 at 17:23
@finn.Bosco, after correcting another error occurs, see below
Dec 1 12:06:06 ithater systemd[1]: Started VK_BOT.
Dec 1 12:06:06 ithater systemd[2144]: vkbot.service: Failed to execute command: Permission denied
Dec 1 12:06:06 ithater systemd[2144]: vkbot.service: Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: Permission denied
Dec 1 12:06:06 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 1 12:06:06 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 12:06:07 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 12:06:07 ithater systemd[1]: vkbot.service: Scheduled restart job restart counter is at 5.
Dec 1 12:06:07 ithater systemd[1]: Stopped VK_BOT.
Dec 1 12:06:07 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 1 12:06:07 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 12:06:07 ithater systemd[1]: Failed to start VK_BOT.


Failed to execute command: Permission denied
Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: Permission denied - finn.Bosco commented on April 2nd 20 at 17:26
@finn.Bosco, give permission to run or run via "python /usr/local/bin/vkbot/bot.py". Well, to do all this as root so-so idea. - jacinto_Hartmann commented on April 2nd 20 at 17:29
@finn.Bosco, @jacinto_Hartmann, @samir.DuBuque, has corrected this mistake by giving all files, the right to exercise the command chmod u+x file_path

Now this error occurs, what's wrong with me? :(
Dec 1 12:24:49 ithater systemd[1]: Stopped VK_BOT.
Dec 1 12:24:49 ithater systemd[1]: Started VK_BOT.
Dec 1 12:24:49 ithater systemd[3021]: vkbot.service: Failed to execute command: Exec format error
Dec 1 12:24:49 ithater systemd[3021]: vkbot.service: Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: Exec format error
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Scheduled restart job restart counter is at 5.
Dec 1 12:24:49 ithater systemd[1]: Stopped VK_BOT.
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 1 12:24:49 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 12:24:49 ithater systemd[1]: Failed to start VK_BOT.


Failed to execute command: Exec format error
Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: Exec format error - finn.Bosco commented on April 2nd 20 at 17:32
@finn.Bosco, what version of Python you expect to run second, third?
that says head-n1 /usr/local/bin/vkbot/bot.py?
and which python?
and which env?
and the env python?
...
generally, @jacinto_Hartmann wrote above, it's easiest to do through the launch of the Python. - samir.DuBuque commented on April 2nd 20 at 17:35
@finn.Bosco, for the executable file must be specified Python in the first line through shebang - jacinto_Hartmann commented on April 2nd 20 at 17:38
@samir.DuBuque, third,

root@ithater:/usr/local/bin/vkbot# head-n1 /usr/local/bin/vkbot/bot.py
import vk_api


root@ithater:/usr/local/bin/vkbot# which python
/usr/bin/python


root@ithater:/usr/local/bin/vkbot# which env
/usr/bin/env


root@ithater:/usr/local/bin/vkbot# env python
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[7.4.0 GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
- finn.Bosco commented on April 2nd 20 at 17:41
@jacinto_Hartmann, meaning "executable file".
something like #!/usr/bin/python or #!/usr/bin/python or #!/usr/bin/env python or #!/usr/bin/env python3. - samir.DuBuque commented on April 2nd 20 at 17:44
@finn.Bosco, the result of a head-n1 /usr/local/bin/vkbot/bot.py and named version of Python:
check 3 versions of Python: which python3. if no - install, if there is - add in /usr/local/bin/vkbot/bot.py the first line #!/usr/bin/env python3 or #!/usr/bin/python3 (python3 which, if you have Python 3, it is likely that the path will point to) and try to start the service again.
...
brings you just a little lack of experience. first, the space in the file name. then the lack of rights to run the script file. now the lack of sebanga the first line of the script. - samir.DuBuque commented on April 2nd 20 at 17:47
@finn.Bosco, ExecStart=/usr/bin/python3 /usr/local/bin/vkbot/bot.py or #!/usr/bin/python3 as the first line in bot.py and better #!/usr/bin/env python3 - jacinto_Hartmann commented on April 2nd 20 at 17:50
@samir.DuBuque, huh, did not notice about 2.7, which thought that in Ubuntu 18.04 already refers to 3rd - jacinto_Hartmann commented on April 2nd 20 at 17:53
@jacinto_Hartmann, legacy. I don't think /usr/bin/python to refer to the 3rd, while in the second repo available. =)
it is another thing. one colleague in bash are always variables in {} wraps (${somevar}), because it's less likely that any antiquity without the bash script will refuse to run, and does not use if'Ah [[ and ]]... and I understand it, though not support. - samir.DuBuque commented on April 2nd 20 at 17:56
@samir.DuBuque, in fact I was very much sums up the lack of experience. - finn.Bosco commented on April 2nd 20 at 17:59
@jacinto_Hartmann, I did not see this review for why not to do after root?
5de3b950da4de643751621.jpeg - finn.Bosco commented on April 2nd 20 at 18:02
@jacinto_Hartmann, @samir.DuBuque, it's all good! Thank you very much for the help!!! <3<3<3 - finn.Bosco commented on April 2nd 20 at 18:05
April 2nd 20 at 17:10
Solution
More thanks to @samir.DuBuque and @jacinto_Hartmann for the help!

Problem, or to be more precise issues decided:

1. Folder first vkbot was an empty symbol, it was removed.
2. Gave all files the right to be executable. chmod u+x file_path
3. ExecStart changed to:
ExecStart=/usr/bin/python3 /usr/local/bin/vkbot/bot.py

Find more questions by tags LinuxPythonsystemd