Runtime error with eventlet and flask/socketio
See original GitHub issueHey,
I’m really hyper by your work, this project is awesome ! Here is my setup:
0.6.5
Python: 3.6.8 (default, Oct 7 2019, 12:59:55)
Executable: /usr/bin/python3
OS: Linux
Arch: x86_64
I’m just having a bit of trouble when compiling it. Here is my code below and the log:
import eventlet
eventlet.monkey_patch()
from flask import Flask
from flask_socketio import SocketIO, send, emit
app = Flask(__name__)
socketio = SocketIO(app)
if __name__ == "__main__":
socketio.run(app, host='127.0.0.1', port=8000)
$> python3 -m nuitka --standalone app.py
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/eventlet/patcher.py:100' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/eventlet/patcher.py:201' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/eventlet/patcher.py:306' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/flask/cli.py:236' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/flask/helpers.py:749' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/flask/helpers.py:818' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/jinja2/loaders.py:472' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/jinja2/utils.py:142' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/jinja2/utils.py:143' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/lib/python3/dist-packages/requests/packages.py:7' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py:186' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py:191' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/werkzeug/utils.py:547' may require use of '--include-plugin-directory' or '--include-plugin-files'.
Nuitka:WARNING:Unresolved '__import__' call at '/usr/local/lib/python3.6/dist-packages/werkzeug/utils.py:555' may require use of '--include-plugin-directory' or '--include-plugin-files'.
As you can see, the compilation is successful but when I try to run it, I get the error:
Traceback (most recent call last):
File "/tmp/nuitka-test/app.dist/app.py", line 4, in <module>
File "/tmp/nuitka-test/app.dist/eventlet/__init__.py", line 10, in <module eventlet>
File "/tmp/nuitka-test/app.dist/eventlet/convenience.py", line 4, in <module eventlet.convenience>
File "/tmp/nuitka-test/app.dist/eventlet/greenpool.py", line 4, in <module eventlet.greenpool>
File "/tmp/nuitka-test/app.dist/eventlet/queue.py", line 49, in <module eventlet.queue>
File "/tmp/nuitka-test/app.dist/eventlet/event.py", line 3, in <module eventlet.event>
File "/tmp/nuitka-test/app.dist/eventlet/hubs/__init__.py", line 19, in <module eventlet.hubs>
File "/tmp/nuitka-test/app.dist/eventlet/hubs/__init__.py", line 19, in <genexpr>
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'eventlet.hubs.epolls'
I also get the error Segmentation fault (core dumped)
on another computer with eventlet==0.24.1
. Eventlet version 0.25.0 changelog indicates that they fixed the eventlet hub where it could use epolls as default hub even when platform does not support it.
When running my app using python3 -B app
, everything works fine. I would think it has something do nuikta faulting the eventlet hub when compiling ? My computer does support epoll.
If I remove the eventlet
library, it builds and the error I get when running it is:
Traceback (most recent call last):
File "/tmp/nuitka-test/app.dist/app.py", line 11, in <module>
File "/tmp/nuitka-test/app.dist/flask_socketio/__init__.py", line 185, in __init__
File "/tmp/nuitka-test/app.dist/flask_socketio/__init__.py", line 245, in init_app
File "/tmp/nuitka-test/app.dist/socketio/server.py", line 108, in __init__
File "/tmp/nuitka-test/app.dist/engineio/server.py", line 139, in __init__
ValueError: Invalid async_mode specified
Which seems very close to a problem that appeared when using pyinstaller
as you can see here as seems to be related to the socketio library (something about hidden imports).
Any suggesions to make this work ? Preferably with eventlet as it has better perf 😃
Thanks for your time and truly great project !
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
I am making progress BTW: my exception has changed 😉 Once I find no more errors I will be submitting new versions of changed Nuitka plugins to you via ZIP file. With some look it will just be the
ImplicitImports.py
plugin, which is located in/nuitka/plugins/standard
. Please replace this module there with the version which I will be sending to you and repeat your compile. After a few back and fro’s we should be there …@tristanidoux - just sent you some more modifications. Hope there will be some progress on your side with them.