2016-05-07 125 views
2

我試過官方演示代碼:如何收拾與蟒flask_socketio應用pyinstaller

#test.py 
from flask import Flask, render_template 
from flask_socketio import SocketIO 

app = Flask(__name__) 
app.config['SECRET_KEY'] = 'secret!' 
socketio = SocketIO(app) 

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

它運行良好,但與包裝:

pyinstaller --onefile test.py 

,然後運行TEST.EXE,我得到:

Z:\test\dist>test2.exe 
Traceback (most recent call last): 
    File "<string>", line 6, in <module> 
    File "site-packages\flask_socketio\__init__.py", line 119, in __init__ 
    File "site-packages\flask_socketio\__init__.py", line 144, in init_app 
    File "site-packages\socketio\server.py", line 72, in __init__ 
    File "site-packages\engineio\server.py", line 100, in __init__ 
ValueError: Invalid async_mode specified 
test2 returned -1 

有什麼我失蹤?

回答