It’s a weird error but I think it’s because you’ve created your Python file in a location that you need system privileges to have lock access to the file.
Either create your python script somewhere else or try running it without debug=True
which shouldn’t then need lock access to the file, e.g.:
app.run_server()