For the error raised, it tells you the python executable is not in the environment variable. In that case, maybe the python is not installed properly or not installed at all. You could open Powershell on windows and simply run: python --version. This could confirm whether python is installed.
By the way, I am comfused that why it raised python error when you complie code in Arduino as you should always run C/C++ in Arduino. Could you please clarify your coding environment?
However, I’ll do my best to help based on the information you’ve shared. If any other Mac users in the community have experience with this, feel free to jump in as well.