我在运行eventlet.monkey_patch()时尝试启动使用flask-socketio的Flask服务器。这是回溯:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/alhasan/MeetupPoint/venv/lib/python3.6/site-packages/werkzeug/serving.py", line 777, in inner
srv.serve_forever()
File "/home/alhasan/MeetupPoint/venv/lib/python3.6/site-packages/werkzeug/serving.py", line 612, in serve_forever
HTTPServer.serve_forever(self)
File "/usr/lib64/python3.6/socketserver.py", line 232, in serve_forever
with _ServerSelector() as selector:
File "/usr/lib64/python3.6/selectors.py", line 348, in __init__
self._poll = select.poll()
AttributeError: module 'select' has no attribute 'poll'
我尝试使用monkey_patch,因为以前我遇到以下错误:
RuntimeError: You need to use the eventlet server. See the Deployment section of the documentation for more information.
我安装了eventlet。
...
eventlet==0.23.0
Flask==0.12.2
Flask-Migrate==2.1.1
Flask-Script==2.0.6
Flask-SocketIO==3.0.1
...
是否有此解决方法?
最初的问题是,每次尝试从客户端发出消息时,服务器都会返回错误请求。但是,另一种方法可行。真的很感激任何一种解决方案。 :)