Closed Voyage-He closed 4 years ago
I agree that generating an exe in Python is a big problem.
pywebview has a basic support for freezing with Pyinstaller, but this is about it. Other freezing solutions either have not been tested or proved to be too much work. However, I have nothing against support for freezing solutions, if somebody has got energy for research and investigation.
Maybe you could start by first stating what freezing solution you tried.
Thank you for your reply!
As I said in the title of this issue, I used pyinstaller. I'm afraid that maybe I made a silly mistake, so I describe my problem more detailed.
|--- index.html |--- demo.py it does work with 'python demo.py' command
then 'pyinstaller -F demo.py' |--- index.html |--- demo.exe error of 'path /index.html was not found' occured after running demo.exe
Your criticism is welcome.
Oh sorry the mail client truncated the title, so did not notice the pyinstaller bit.
Does it work without the onefile option?
With -F or without -F With http_server or without http_server And I try to put html file in an ‘assets’ directory These all didn’t work
Actually, the thing I want to know most is whether this situation only appears to me? If so, I may consider more about the problem of MY environment, or my computer Maybe, I should try to restart from reinstalling python. haha
I will check paths when I get a chance.
The thing with one file is that you have to include your asset inside your executable using the data switch. Placing it along the exe file would not work.
Bad news. My Windows machine broke so I am not able to look into this at the moment.
I managed to test it and this is caused by the assets
dir not being included with pyinstaller. Look into the Adding files section of pyinstaller docs.
https://pyinstaller.readthedocs.io/en/stable/spec-files.html
Thank you soooo much!
Specification
Description
I test a demo from doc
import webview
window = webview.create_window('Woah dude!', 'index.html') webview.start(http_server=True)
really awesome project among so many webview implementations! But in Python, generating exe is a big problem.....