indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.4k stars 234 forks source link

WebViews not supported in memory #282

Open psytron opened 4 years ago

psytron commented 4 years ago

Experiencing: error: in-memory-only resources policy active but in-memory extension module importing not supported by this configuration

When using WebViews: https://github.com/r0x0r/pywebview https://github.com/samuelhwilliams/Eel

What is best way to add WebView with HTML GUI to Pyoxidizer app?

Overall Pyoxidizer is genius. The in-memory magic for imports / no temp-dir at runtime, brilliant. This project is a huge leap forward in combining the playful and intuitive nature of Python with the security and power of Rust. I reused previous issue since I realized 0.7 version docs are different from 0.8

indygreg commented 3 years ago

This error message and defaults around where things are loaded from should be changed to be more user friendly.

The issue is that you are telling PyOxidizer to load/import an extension module from memory as a shared library but this is only supported on Windows. In some cases, PyOxidizer will be able to recompile the extension and statically link it into the executable. But this doesn't always work.

Could you please install the latest commit of PyOxidizer via cargo install --git https://github.com/indygreg/PyOxidizer.git --branch main pyoxidizer and report on your new experience? Please note that a lot has changed in Starlark since the 0.7 release. See the docs for the main branch at https://pyoxidizer.readthedocs.io/en/latest/index.html: the changelog is at https://pyoxidizer.readthedocs.io/en/latest/history.html#version-history.

psytron commented 3 years ago

Thank You for the summary and troubleshooting tips. We temporarily migrated back to Electron as our app has 3D webGL GUI running in webview, but will follow up here once we run more PyOxidizer/pywebview tests.