pyinstaller executable: PyQt5 QFileDialog doesn't list any files

29 views
Skip to first unread message

Stefaan Himpe

unread,
Oct 14, 2019, 3:52:42 AM10/14/19
to PyInstaller
hi all,

I'm experiencing weird behaviour in a pyinstaller generated executable.

Everything seems to work, except when selecting a file using a QFileDialog:
The QFileDialog shows up and I can type in filenames and folder names and they will even autocomplete, 
but no matter what file filters are selected, the file area where normally folder names and file names are listed
remains completely empty.

I'm currently trying pyinstaller 4.0.dev0+3f57c914226 with python 3.7.4 on Linux-5.3.5-arch1-1-ARCH-x86_64-with-arch, 
but the same problem happens with pyinstaller 3.5

I have upx available, but the same problem happens without upx

Same problem for --one-file and --one-dir

I have run strace but nothing suspicious showed up.

I'm using KDE5 desktop environment.

When the file dialog is opened, the following error is displayed on the console
(this happens both when running from directly from python source code - where everything works as expected - 
and when running from pyinstaller generated executable - where it seems to be broken):
kf5.kio.core: "Could not enter folder tags:/."

I've attached 2 screenshots to illustrate the difference. 
Any ideas? I'm a bit lost as to how to continue.

Thanks.


frompython.png
frompyinstaller.png

Hartmut Goebel

unread,
Oct 15, 2019, 6:34:13 AM10/15/19
to pyins...@googlegroups.com
Am 13.10.19 um 14:20 schrieb Stefaan Himpe:
Everything seems to work, except when selecting a file using a QFileDialog:
The QFileDialog shows up and I can type in filenames and folder names and they will even autocomplete, 
but no matter what file filters are selected, the file area where normally folder names and file names are listed
remains completely empty.

Thanks for providing the information and testing different build variations. This does not look like to being caused by PyInstaller.

Please ensure there are actually AC7 files in this folder. Maybe adding a pattern for "all files" helps?


When the file dialog is opened, the following error is displayed on the console
(this happens both when running from directly from python source code - where everything works as expected - 
and when running from pyinstaller generated executable - where it seems to be broken):
kf5.kio.core: "Could not enter folder tags:/."


I get the same message in on of my applications, thus I strongly assume this s unrelated.


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/frauenhofer-promoted-gnunet-mit-heisser-luft
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-09-kommerz-uber-recht-fdp-die-gefaellt-mir-partei

0x7B752811BF773B65.asc

Stefaan Himpe

unread,
Oct 15, 2019, 9:28:09 AM10/15/19
to PyInstaller
Hi Hartmut,

Thanks for replying!

I probably should have mentioned that I added a pattern for all files as well and the behavior is exactly the same, only in pyinstaller frozen executable no files or folders appear. From source it works as expected.

However, I've been able to work around the problem by modifying my Qt code *not* to use "Native File Dialogs".
When Qt displays the file dialog using its internal implementation instead of trying to use the KDE5 one, it works perfectly both in source and frozen form.

So I'm guessing there must be some shared library that is not found/included although so far I didn't find any way to get an error message or to somehow get a grip on the problem.
(Also important: the Qt internal file dialog suffices for my needs, so the problem is lowered in priority).

Best regards,
Stefaan.

Hartmut Goebel

unread,
Oct 15, 2019, 9:59:22 AM10/15/19
to pyins...@googlegroups.com
Am 15.10.19 um 15:25 schrieb Stefaan Himpe:
However, I've been able to work around the problem by modifying my Qt code *not* to use "Native File Dialogs".
When Qt displays the file dialog using its internal implementation instead of trying to use the KDE5 one, it works perfectly both in source and frozen form.

So I'm guessing there must be some shared library that is not found/included although so far I didn't find any way to get an error message or to somehow get a grip on the problem.

Yes, this looks Qt requires some other shared library to access the "Native File Dialogs".

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

0x7B752811BF773B65.asc
Reply all
Reply to author
Forward
0 new messages