I wrote a simple Python program 'guessing_game.py'. When I try to run this code in the command prompt using python -m guessing_game.py, the program runs fine, but in the end, it says:

Error while finding module specification for 'guessing_game.py'
(ModuleNotFoundError: path attribute not found on 'guessing_game'
while trying to find 'guessing_game.py').

When I run the same program using python -guessing_game.py, it runs fine, and it doesn't show that message as well.
Because you're trying to run it as a module?

-m  Search sys.path for the named module and execute its contents as the main module.
Since the argument is a module name, you must not give a file
  extension (.py). The module-name should be a valid Python module name,
  but the implementation may not always enforce this (e.g. it may allow
  you to use a name that includes a hyphen).
ModuleNotFoundError: __path__ attribute not found on 'guessing_game' while trying to find 'guessing_game.py'