'bash: python: command not found

I've recently installed Sublime text on Ubuntu. When I try to run some python code, the following error is popped up:

bash: python: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: python -u "/home/user/Desktop/Python Project/test.py"]
[dir: /home/user/Desktop/Python Project]
[path: /home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]

when I run python on the commandline, I get:


  command 'python3' from deb python3
  command 'python' from deb python-is-python3

When I run python3 on the commandline, I get:

Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source