I\'m using Flask for developing a website and while in development I run flask using the following file:
#!/usr/bin/env python
from datetime import datetime
I had the same issue. I solved it by modifying my main and inserting use_reloader=False into it. If any body is here looking for a workaround for this problem then below code will get you started, however you will the functionality of changes in code being detected automatically by and restarting the application will not work. You will have to manually stop and restart you application after each edit in code.
if __name__ == '__main__':
app.run(debug=True, use_reloader=False)