mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-25 11:45:49 +03:00
[GH-ISSUE #433] Python 3.12.0 ModuleNotFoundError: No module named 'bottle.ext.websocket' #345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @neelkalpa on GitHub (Oct 3, 2023).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/433
Originally assigned to: @brentvollebregt on GitHub.
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Program Files\Python312\Lib\site-packages\auto_py_to_exe_main.py", line 10, in
from . import ui
File "C:\Program Files\Python312\Lib\site-packages\auto_py_to_exe\ui.py", line 6, in
import eel
File "C:\Program Files\Python312\Lib\site-packages\eel_init.py", line 16, in
import bottle.ext.websocket as wbs
ModuleNotFoundError: No module named 'bottle.ext.websocket'
Tried solving like this:
pip install bottle-websocket
pip install eel
However, it didn't work!
@github-actions[bot] commented on GitHub (Oct 3, 2023):
👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.
Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.
@brentvollebregt commented on GitHub (Oct 4, 2023):
Could you try the following
Do you get the same issue? With you clearing the issue template out, I can't offer much more than this immediately 😕
@DLord420 commented on GitHub (Oct 4, 2023):
Same problem here. Also on python 3.12.
I get the same error when trying to open the app in CMD.
@neelkalpa commented on GitHub (Oct 4, 2023):
It works in virtual environment. But it doesn't work outside of it. Any remedy?
@Wilsman commented on GitHub (Oct 4, 2023):
just ran into the same issue. Also, not too sure how to run it in a venv 🥲
@brentvollebregt commented on GitHub (Oct 5, 2023):
This shows that the issue is the packages installed in your environment.
To fix this, run one of the following:
pip install auto-py-to-exe --upgrade --force-reinstallpip install -r .\requirements.txt --upgrade --force-reinstallat the root of this projectUpdate: these solutions will not work!
@Wilsman commented on GitHub (Oct 5, 2023):
has the issue stemmed from upgrading to Python 3.12.0?
@brentvollebregt commented on GitHub (Oct 5, 2023):
That's a good thought!
Even though @neelkalpa didn't say what Python version they were using, I think I can assume 3.12 judging by the paths. I imagine the virtual environment was the same version.
I just added Python 3.12 to the tests in this repo and they seemed to run fine - so it looks like an upgrade to 3.12 should be ok.
@CwGmZ971 commented on GitHub (Oct 5, 2023):
Have tried this and this has not fixed the issue, this issue is persistent with Python 3.12.0 when running auto-py-to-exe from the command prompt (CMD)
@Wilsman commented on GitHub (Oct 5, 2023):
I tried the same and failed... i uploaded a pastebin of my terminal which may/may not help 🤞
terminal - pastebin
@brentvollebregt commented on GitHub (Oct 5, 2023):
Thank you, I have been able to reproduce this now,
C:\...\Python312\python.exe -m venv .venvC:\...\.venv\Scripts\python.exe --versiongives "Python 3.12.0"C:\...\.venv\Scripts\python.exe -m pip install auto-py-to-exeC:\...\.venv\Scripts\python.exe -m auto_py_to_exeI get the same as above,
This looks like an Eel issue, executing
C:\...\.venv\Scripts\python.exe -c "import eel"gives the same error. I can't see any recent releases in Eel or bottle.Interestingly, looking at how
import bottle.ext.websocketworks, it actually imports the packagebottle-websocket. I see I havebottle-websocket0.2.9 installed so this is a bit odd that it can't import it, maybe bottle's_ImportRedirectis broken?@brentvollebregt commented on GitHub (Oct 5, 2023):
bottle's last release was on March 5, 2023 with version 0.12.25. Since then, there have been a few changes put on master, but no release has been made to push these changes to PyPI.
I just tried the bottle.py on master in my local setup and it worked fine. So it looks like the code is available, it just hasn't been pushed to PyPI.
Update: The "there have been a few changes put on master" link doesn't give much insight as the master branch and release branch in bottles repo don't hold the same changes.
@DLord420 commented on GitHub (Oct 5, 2023):
Cleared PIP cache and tried
pip install auto-py-to-exe --upgrade --force-reinstallagain with no luck.@brentvollebregt commented on GitHub (Oct 5, 2023):
Yep, my bad,
pip install auto-py-to-exe --upgrade --force-reinstallwill not work. Until that bottle change comes though, it doesn't look like we can resolve this.@Wilsman commented on GitHub (Oct 5, 2023):
thanks for looking into this 👍
@brentvollebregt commented on GitHub (Oct 5, 2023):
The commit we need was put on master back on June 13, 2022 but it appears that releases are not directly done master, but instead in their own release branch - so that explains how the commit was made so long ago but is not in the recent release.
@brentvollebregt commented on GitHub (Oct 5, 2023):
I've created an issue at https://github.com/bottlepy/bottle/issues/1430 to let bottle know
@errantSquam commented on GitHub (Oct 9, 2023):
Hi, thanks for creating the issue!
For everyone else encountering the problem, quick fix I've found using the information raised by @brentvollebregt: Navigate to
Python312/Lib/site-packages/bottle.py, and replace the code with the linked version:github.com/bottlepy/bottle@ca6762c559/bottle.py@brentvollebregt commented on GitHub (Oct 9, 2023):
I have a temporary solution in #434 - this seems to work ok for me.
Could someone else that's having this issue try this out and let me know if it works for you? If so, I'll merge it in and create a release.
@DLord420 commented on GitHub (Oct 9, 2023):
Tried the proposed solution and it did not work on my machine. I just got page after page error messages ending with:> NameError: name 'true' is not defined. Did you mean: 'True'?My apologies, somehow the .py file got messed up while downloading. Had to go to the github address and download it in raw format.
I confirm that the work around indeed solves the problem. Many thanks to all.
@Wilsman commented on GitHub (Oct 9, 2023):
This quick fix worked.
@brentvollebregt commented on GitHub (Oct 9, 2023):
This should now be fixed in auto-py-to-exe 2.41.0 with the shim added in #434.
I'll close this for now, but if you are still facing this issue please comment here and provide the following:
pip show auto-py-to-exepython --versionpip show bottleHopefully bottle fixes this soon and we can remove the shim.
@DLord420 commented on GitHub (Oct 9, 2023):
Just FYI, if you use
pip install auto-py-to-exe --upgradeto upgrade to the new version (2.41.0), you will get errors and it won't run.Make sure to use
pip install auto-py-to-exe --upgrade --force-reinstall