Windows10, pyinstaller, and PySide2/QWebEngineView

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows10, pyinstaller, and PySide2/QWebEngineView

ijbrewster
I’m having problems getting PySide2/QWebEngineView to work on windows with PyInstaller. In short, even when just doing a very basic “Hello world” page via setHTML, nothing is ever displayed. Of course the app works properly when not run via PyInstaller.

Details:
- As per the instructions at https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly, I am running pyinstaller in the —onesie mode, with the latest development version, from a command window, without UPX, and in debug mode
- no errors of any sort are generated when running
- I have a custom hook set up to collect data files for shiboken2 and PySide2:

from PyInstaller.utils.hooks import collect_data_files

datas = collect_data_files('shiboken2', include_py_files=True, subdir='support')
datas += collect_data_files('PySide2', include_py_files=True, subdir='support’)

- I set the “QTWEBENGINEPROCESS_PATH” environment variable to point to the QtWebEngineProcess.exe, thus eliminating that error
- I made sure my .spec file included the translations and resources directories in the proper location, thus eliminating those errors

So at this point, I have cleaned up all the errors that are reported, but still don’t get any display in the QWebEngineView, even for the most basic of pages. Where can I look next? Output when running is below.

$ ./dist/SO2\ Explorer/SO2\ Explorer.exe
[160] PyInstaller Bootloader 3.x
[160] LOADER: executable is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer\SO2 Explorer.exe
[160] LOADER: homepath is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer
[160] LOADER: _MEIPASS2 is NULL
[160] LOADER: archivename is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer\SO2 Explorer.exe
[160] LOADER: No need to extract files to run; setting extractionpath to homepath
[160] LOADER: SetDllDirectory(C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer)
[160] LOADER: Already in the child - running user's code.
[160] LOADER: Python library: C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer\python37.dll
[160] LOADER: Loaded functions from Python library.
[160] LOADER: Manipulating environment (sys.path, sys.prefix)
[160] LOADER: sys.prefix is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer
[160] LOADER: Pre-init sys.path is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer\base_library.zip;C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer
[160] LOADER: Setting runtime options
[160] LOADER: Initializing python
[160] LOADER: Overriding Python's sys.path
[160] LOADER: Post-init sys.path is C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer\base_library.zip;C:\Users\Israel\Development-Win\tropomi_gui\dist\SO2 Explorer
[160] LOADER: Setting sys.argv
[160] LOADER: setting sys._MEIPASS
[160] LOADER: importing modules from CArchive
[160] LOADER: extracted struct
[160] LOADER: callfunction returned...
[160] LOADER: extracted pyimod01_os_path
[160] LOADER: callfunction returned...
[160] LOADER: extracted pyimod02_archive
[160] LOADER: callfunction returned...
[160] LOADER: extracted pyimod03_importers
[160] LOADER: callfunction returned...
[160] LOADER: Installing PYZ archive with Python modules.
[160] LOADER: PYZ archive: PYZ-00.pyz
[160] LOADER: Running pyiboot01_bootstrap.py
[160] LOADER: Running runtimehook-harp.py
[160] LOADER: Running pyi_rth_qt5plugins.py
[160] LOADER: Running pyi_rth_pkgres.py
[160] LOADER: Running pyi_rth_win32comgenpy.py
[160] LOADER: Running pyi_rth_multiprocessing.py
[160] LOADER: Running pyi_rth_qt5webengine.py
[160] LOADER: Running SO2 Explorer.py

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Windows10, pyinstaller, and PySide2/QWebEngineView

Raoul Snyman
[160] LOADER: Running SO2 Explorer.py

What happens when you remove the spaces from your file names? 

As a general rule I never put spaces in my file names, they always cause issues somewhere.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Windows10, pyinstaller, and PySide2/QWebEngineView

ijbrewster
Removing the spaces has no effect. In fact, if it did, that would be a bug - spaces have been legal in file names for quite a few years now, anything that still has issues with them has a bug and needs to be fixed.

That said, in the four days since I originally tried to post this to the list (apparently it took over two days to post?) I did manage to figure out the problem. By running the app through WinDbg, I was able to catch the error messages being generated by the background QtWebEngineProcess.exe, which indicated that it, in fact, COULDN'T find the qtwebengine_locales or ICU data files after all. After some more tweaking, it turns out I needed to place these in two different locations: 1) in the PySide2 directory, under the translations and Resources directories respectively, and 2) directly in the same directory that the QtWebEngineProcess.exe is in (PySide2 in my case). I had only put them in the PySide2/translations and PySide2/Resources directories, so QtWebEngineProcess.exe wasn’t finding them. If I only put them in the same directory as the QtWebEngineProcess.exe, and not in the respective sub-directories as well, then I get an error about them missing when launching the program. Having the files in both locations enables proper functionality.

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

On Apr 21, 2019, at 11:26 PM, Raoul Snyman <[hidden email]> wrote:

[160] LOADER: Running SO2 Explorer.py

What happens when you remove the spaces from your file names? 

As a general rule I never put spaces in my file names, they always cause issues somewhere.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.