question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named 'bottle-websocket' when running an executable made with PyInstaller, including Eel module

See original GitHub issue

I Made a simple program, tried to make an executable out of it via PyInstaller. No errors whatsoever, but when running this executable it crashes on the first line - import eel, telling - there is no module called ‘bottle-websocket’.

I checked pip: eel, bottle-websocket are installed. Can’t figure out what’s the problem. Runs perfectly as a raw python file, but when executed throws this weird error. Attachments:

main.py:

import eel
import sys

def getcurrentdir():
    a = sys.argv[0].split("\\")
    currentdir = ''
    for i in range(len(a) - 1):
        currentdir += a[i] + "\\"
    return currentdir

eel.init(getcurrentdir + "\\web")
eel.start('main.html', block=False)
while True:
   eel.sleep(10)

Error: CMD error

I found this in PyInstaller Warning file:

bottle.ext' MissingModule
imported by: eel

PyInstaller’s Log

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
pauliyobocommented, Jul 29, 2019

To those who are still facing this issue. A probably not optimal way to fix it is to import bottle?websocket in your main file. so do something like: import eel import bottle_websocket

eel.init(‘web’) eel.start(‘main.html’)

2reactions
Treedyecommented, Dec 8, 2018

Hi, I was actually following the tutorial until it threw some errors about a web folder not being empty. Now I tried with the empty web folder and it worked, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: no module named 'bottle-websocket' when running an ...
this command will get the 'bottle-websocket' work and will make sure that it complies with the web folder and files.
Read more >
No module named 'bottle-websocket' when running ... - GitHub
I Made a simple program, tried to make an executable out of it via PyInstaller. No errors whatsoever, but when running this executable...
Read more >
Python: no module named 'bottle-websocket' when running an ...
Made a simple program, tried to make an executable out of it via PyInstaller. No errors whatsoever, but when running this executable it...
Read more >
Pyinstaller: Module not found when running .exe when ...
This works find in PyCharm, but when I produce a Windows exe using PyInstaller it errors at runtime: .\pyinst_excel.exe Traceback (most recent call...
Read more >
python pyinstaller/auto-py-to-exe 打包失敗 - iT 邦幫忙
python pyinstaller/auto-py-to-exe 打包失敗. python. pyinstaller ... 已經安裝了但是還是會依直出現No module named XXX ... 6301 INFO: Including run-time hook ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found