I'm using PyInstaller to bundle a PySide2 application. In my application, I 
use QDesktopServices.openUrl 
(https://doc.qt.io/qt-5/qdesktopservices.html#openUrl) to open a PDF 
version of the user manual when the user clicks on the Help menu.

This works fine when I run the PySide2 application from terminal, whether 
it's on my Mac, Windows, or Ubuntu machines; it opens the manual in 
Preview, Microsoft Edge, and Evince, respectively. However, when I use 
PyInstaller to bundle the application via `pyinstaller MainWindow.py`, I 
get the following error on Ubuntu when I try to open the PDF:
`evince: error while loading shared libraries: libgdk-3.so.0: failed to map 
segment from shared object`

If I remove libgdk-3.so from the application bundle, I get the error:
`evince: error while loading shared libraries: libpangocairo-1.0.so.0: 
failed to map segment from shared object`
And this error continues with a different library if I then remove 
libpangocairo-1.0.so. I tried doing that through about 20 different 
libraries before I stopped trying to see when the issue would end.

Evidently, this issue has been seen before. On 
https://answers.launchpad.net/kathaikalam/+question/206392, the program was 
explicitly calling Evince to open the PDF file, so the developer fixed the 
issue by calling xpdf instead. However, since QDesktopServices opens a 
local file using the operating system's default program, I can't tell it 
not to use Evince.

So is there any way to get Evince to work with PyInstaller? Or any other 
workarounds? I thought about having my program determine if the OS is 
Ubuntu, and if so, not using QDesktopServices but instead explicitly use 
xpdf or some other program, but the issue there is that the user might not 
have that program installed. QDesktopServices is very nice in that it calls 
a program that's known to be present on the user's system.

I'm using Ubuntu 20.04.2 LTS, PySide2 5.15.2, and PyInstaller 4.2.

Efrem Braun

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/0b927c78-dcac-44d9-91ce-e252bf63e8a9n%40googlegroups.com.

Reply via email to