You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
ModuleNotFoundError: No module named 'gevent.__hub_local' #62
Hi! when building a distributable binary, and try to execute it the following error appear:
Traceback (most recent call last):
File "hello.py", line 1, in <module>
File "/home/pc-ia/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "eel/__init__.py", line 2, in <module>
File "/home/pc-ia/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "gevent/__init__.py", line 87, in <module>
File "/home/pc-ia/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "gevent/_hub_local.py", line 101, in <module>
File "gevent/_util.py", line 105, in import_c_accel
File "importlib/__init__.py", line 126, in import_module
ModuleNotFoundError: No module named 'gevent.__hub_local'
changed the title [-]label:bug ModuleNotFoundError: No module named 'gevent.__hub_local'[/-][+]ModuleNotFoundError: No module named 'gevent.__hub_local'[/+]on Jul 9, 2018
@sedir I do not know why it appeared ... but I fixed it by installing these packages with this version:
gevent==1.2.2
Eel==0.9.7
gevent-websocket==0.10.1
greenlet==0.4.13
PyInstaller==3.3.1
@sedir I do not know why it appeared ... but I fixed it by installing these packages with this version:
gevent==1.2.2
Eel==0.9.7
gevent-websocket==0.10.1
greenlet==0.4.13
PyInstaller==3.3.1
Great , it saved my day thanks
I would like to know how this works
@sedir I do not know why it appeared ... but I fixed it by installing these packages with this version:
gevent==1.2.2
Eel==0.9.7
gevent-websocket==0.10.1
greenlet==0.4.13
PyInstaller==3.3.1
This also worked to me, but to clarify further for anyone else with this problem, it seems like the gevent version is the most important, and having a later version can cause problems. I was able to build but not run an EXE created with gevent==1.3.7 and after downgrading to 1.2.2 (pip install gevent==1.2.2) I was able to successfully build an EXE that ran under Windows.
linux have similar fails, without way to solve it
os kubuntu 18.04
PyInstaller: 3.3.1
Python: 3.6.7
when i run pyinstaller with last bottle/bottle-websocket/gevent etc versions i have this fail of executable
Traceback (most recent call last): File "d.py", line 3, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "eel/__init__.py", line 2, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "gevent/__init__.py", line 87, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "gevent/_hub_local.py", line 101, in <module> File "gevent/_util.py", line 105, in import_c_accel File "importlib/__init__.py", line 126, in import_module ModuleNotFoundError: No module named 'gevent.__hub_local' [20371] Failed to execute script d
When i rollback from fresh libs to gevent 1.2.2 (pip3 uninstall gevent -> pip3 install gevent=1.2.2) and rerun same i have this fail with executable
Traceback (most recent call last): File "d.py", line 3, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "eel/__init__.py", line 8, in <module> File "bottle.py", line 1797, in load_module ModuleNotFoundError: No module named 'bottle_websocket' [20916] Failed to execute script d
@sedir I do not know why it appeared ... but I fixed it by installing these packages with this version:
gevent==1.2.2
Eel==0.9.7
gevent-websocket==0.10.1
greenlet==0.4.13
PyInstaller==3.3.1
This also worked to me, but to clarify further for anyone else with this problem, it seems like the gevent version is the most important, and having a later version can cause problems. I was able to build but not run an EXE created with gevent==1.3.7 and after downgrading to 1.2.2 (pip install gevent==1.2.2) I was able to successfully build an EXE that ran under Windows.
0-i am on linux
1- i have worked done (from source) basic eel app helloworld level it just call python3 print() operator from javascript code https://github.com/3dformortals/data/tree/master/python/DASprogress/eel
2- from d.py level i execute terminal command pyinstaller d.py --onefile , and all done without errors
3- click on programm d without exe, because linux, show me nothing
4- from d level terminal execution of ./d show me errors above
If you use python3 -m eel instead of calling pyinstaller directly it will include things like bottle automatically. This is mentioned in the readme but not pointed out especially, quite a lot of people miss it
If you use python3 -m eel instead of calling pyinstaller directly it will include things like bottle automatically. This is mentioned in the readme but not pointed out especially, quite a lot of people miss it
how should looks final command for my d.py file? Something like python3 -m eel blackmagic d.py --onefile? I need executable output.
... looks like i found info. python3 -m eel d.py web --onefile, resulted executable work on linux . Now i need discover what is Promise output result from python side function to javascript, and how work with it.
You need to either use a callback method, or await keyword to get return value from Python. There are examples in the README
yep, thanx, you're right. var x = await pythonsidefunction()() or let x = await pythonsidefunction()() (let in case when i need error raising vs undefined in var case) work as expected.
Is it possible that in the future pyinstaller d.py --onefile will work same as python3 -m eel d.py web --onefile, or i miss something etc?
Activity
[-]label:bug ModuleNotFoundError: No module named 'gevent.__hub_local'[/-][+]ModuleNotFoundError: No module named 'gevent.__hub_local'[/+]sedir commentedon Jul 13, 2018
@Marcelpv96 why did you close the issue? I'm having the same problem and don't know why. Did you figure this out?
Marcelpv96 commentedon Jul 19, 2018
@sedir I do not know why it appeared ... but I fixed it by installing these packages with this version:
gevent==1.2.2
Eel==0.9.7
gevent-websocket==0.10.1
greenlet==0.4.13
PyInstaller==3.3.1
ChrisKnott commentedon Jul 19, 2018
@Marcelpv96 thanks, I'll add these as requirements
abhishekwebcode commentedon Jul 31, 2018
@Marcelpv96
Great , it saved my day thanks
I would like to know how this works
aaknitt commentedon Jan 12, 2019
This also worked to me, but to clarify further for anyone else with this problem, it seems like the gevent version is the most important, and having a later version can cause problems. I was able to build but not run an EXE created with gevent==1.3.7 and after downgrading to 1.2.2 (pip install gevent==1.2.2) I was able to successfully build an EXE that ran under Windows.
3dformortals commentedon Feb 10, 2019
linux have similar fails, without way to solve it
os kubuntu 18.04
PyInstaller: 3.3.1
Python: 3.6.7
when i run pyinstaller with last bottle/bottle-websocket/gevent etc versions i have this fail of executable
Traceback (most recent call last): File "d.py", line 3, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "eel/__init__.py", line 2, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "gevent/__init__.py", line 87, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "gevent/_hub_local.py", line 101, in <module> File "gevent/_util.py", line 105, in import_c_accel File "importlib/__init__.py", line 126, in import_module ModuleNotFoundError: No module named 'gevent.__hub_local' [20371] Failed to execute script dWhen i rollback from fresh libs to gevent 1.2.2 (pip3 uninstall gevent -> pip3 install gevent=1.2.2) and rerun same i have this fail with executable
Traceback (most recent call last): File "d.py", line 3, in <module> File "/home/user/.local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "eel/__init__.py", line 8, in <module> File "bottle.py", line 1797, in load_module ModuleNotFoundError: No module named 'bottle_websocket' [20916] Failed to execute script d... issue looks
closed and not solvedChrisKnott commentedon Feb 10, 2019
@3dformortals Exactly what command are you running?
3dformortals commentedon Feb 10, 2019
0-i am on linux
1- i have worked done (from source) basic eel app helloworld level it just call python3 print() operator from javascript code
https://github.com/3dformortals/data/tree/master/python/DASprogress/eel
2- from d.py level i execute terminal command
pyinstaller d.py --onefile, and all done without errors3- click on programm
dwithout exe, because linux, show me nothing4- from
dlevel terminal execution of./dshow me errors aboveChrisKnott commentedon Feb 10, 2019
If you use
python3 -m eelinstead of calling pyinstaller directly it will include things like bottle automatically. This is mentioned in the readme but not pointed out especially, quite a lot of people miss it3dformortals commentedon Feb 10, 2019
how should looks final command for my
d.pyfile? Something likepython3 -m eel blackmagic d.py --onefile? I need executable output.... looks like i found info.
python3 -m eel d.py web --onefile, resulted executable work on linux . Now i need discover what isPromiseoutput result from python side function to javascript, and how work with it.ChrisKnott commentedon Feb 11, 2019
You need to either use a callback method, or
awaitkeyword to get return value from Python. There are examples in the README3dformortals commentedon Feb 11, 2019
yep, thanx, you're right.
var x = await pythonsidefunction()()orlet x = await pythonsidefunction()()(letin case when i need error raising vs undefined invarcase) work as expected.Is it possible that in the future
pyinstaller d.py --onefilewill work same aspython3 -m eel d.py web --onefile, or i miss something etc?ChrisKnott commentedon Feb 11, 2019
The reason for using the
-m eelsyntax is that it automatically includes some necessary modules that pyinstaller leaves out.If you look at the code you can see the actual pyinstaller command that it calls
https://github.com/ChrisKnott/Eel/blob/master/eel/__main__.py
I don't think pyinstaller is clever enough to know that Eel uses gevent and bottle, which is why you need the
--hidden-importpart