Flask APP - ValueError: signal only works in main thread

后端 未结 2 1870
时光取名叫无心
时光取名叫无心 2020-12-08 11:13

I try to create a simple flask app:

from flask import Flask

app = Flask(__name__)

if __name__ == \'__main__\':
  app.run()

but when I add

2条回答
  •  执笔经年
    2020-12-08 11:26

    The problem you are facing has to do with a bug in the Flask-SocketIO package which replaces the flask run command. Due to this Flask-SocketIO is always used even if you don’t import it. There are several solutions:

    1. Uninstall Flask-SocketIO
    2. Do not use flask run but run the main file of your program
    3. Disable debugging
    4. Disable auto loading if debugging required flask run --no-reload

    Reference to the Flask-SocketIO bug: issue 817

提交回复
热议问题