Just replying to an old topic as it might help someone in the future - I was just struggling with the same error. Turns out you need to be editing a python file on the device itself to be able to run it. Under the 'main.py' tab at the top right of your screen shot, you can see that this file is located in folder 'm5stack ...'. This should show 'COM8 > flash > main.py' or similar if you are editing the version on the device (just click on the 'main.py' under your highlit 'COM8' on the bottom left to select the file on the device before trying to run rather than the file on your local PC).
H