Nuitka doesn't work with pywebview
See original GitHub issueI’m trying to use the Python module pywebview with Nuitka and I’m not able to to get it to work. I’ve tried to manually copy over the WebBrowserInterop.x86.dll
and WebBrowserInterop.x64.dll
files from site-packages/webview/lib
and still no success. Am I missing something or is Nuitka not linking/including something correctly?
Python, Nuitka, and System Information
0.6.3.1
Python: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Executable: C:\Python37\python.exe
OS: Windows
Arch: x86_64
main.py
import webview
webview.create_window(title="Hello World!", url="https://www.google.com/")
build.sh
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $0 -source"
exit 1
fi
if [ -d "./dist" ]; then
rm -rf ./dist
mkdir ./dist
else
mkdir ./dist
fi
python -m nuitka --show-progress --standalone --recurse-all --experimental=use_pefile --experimental=use_pefile_recurse --experimental=use_pefile_fullrecurse --include-package=webview --output-dir=./dist $1
d="$(sed s/[\.py]//g <<< $1)"
mv ./dist/$d.dist/* ./dist
rm -rf ./dist/$d.build
rm -rf ./dist/$d.dist
./main.exe
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\jason\Projects\scratchpad\webview\dist\Python.Runtime.dll' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at clrModule.PyInit_clr()
Any help on this would be great! – Jason.
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Nuitka compilation error when building on windows
Everything seems to work fine (Pass 1 and Pass 2) but when it comes to compiling the generated C code I keep getting...
Read more >How do you make a python UI that doesn't look like garbage?
I just stumbled across this kinda old post and just thought I'd recommend pywebview. You don't need to use a server like you...
Read more >https://nuitka.net/apidoc/classnuitka_1_1plugins_1...
No information is available for this page.
Read more >【Nuitka】python打包单文件- 代码诠释的世界 - 博客园
This means not a folder, but a compressed executable is created and used. ... Default uses what you are using to run Nuitka,...
Read more >pynsist Documentation
If you use binary packages, packages compiled for. Python 3.3 won't work with Python 3.4. The other lines make sure it can find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, those pointers will be good enough.
I think for Nuitka, this ought to be good enough:
That should point to
webview/util
as a folder for the DLLs inside the dist folder, because__file__
is updated correctly with Nuitka. Not sure why PyInstaller needs more help there, but I also don’t care.This is part of the 0.6.18 release.