Flask-socketio: How to pack flask-socketio app with pyinstaller

Created on 7 May 2016  路  3Comments  路  Source: miguelgrinberg/Flask-SocketIO

I tried simple test code:

test.py

from flask import Flask, jsonify, request, render_template
from flask_socketio import SocketIO

class REST():
def init(self):
self.app = Flask(name)
self.app.config['SECRET_KEY'] = 'freego!'
# , async_mode="eventlet"
self.socketio = SocketIO(self.app)

def run(self):
    #self.init_routes()
    self.socketio.run(self.app, host='0.0.0.0', port=4444)

REST().run()

run it without problem, but pack it with: pyinstaller --onefile test.py
and run test.exe, I got :
Traceback (most recent call last):
File "", line 59, in
File "", line 12, in init
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
test returned -1
I tried with or without eventlet installed, or without --onefile, or pyinstaller --onefile --hidden-import=eventlet -F test.py
it's no differrent.
any suggestion?

Most helpful comment

What is the real solution? It still does not work for me.

All 3 comments

Closing this, as it has been addressed here: https://github.com/miguelgrinberg/python-socketio/issues/35.

What is the real solution? It still does not work for me.

What is the real solution? It still does not work for me.

https://github.com/miguelgrinberg/python-socketio/issues/35#issuecomment-482350874

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EndenDragon picture EndenDragon  路  3Comments

nayebare picture nayebare  路  4Comments

nh916 picture nh916  路  3Comments

j2logo picture j2logo  路  3Comments

thehelpfulbees picture thehelpfulbees  路  4Comments