Bundling Platform plugin folder with pyinstaller (--onefile)

1,191 views
Skip to first unread message

Mahmoodreza Aarabi

unread,
Apr 28, 2014, 6:18:44 AM4/28/14
to pyins...@googlegroups.com
i create my exe file (in windows8 x64) and it works fine. but problem is that when i run my exe file in client system (or a clean VM - that just install vcredist_x64) it does not work and give me this error:

This application failed to start because it could not find or load the Qt platform plugin “windows”.

Available platform plugins are: minimal, offscreen, windows.

Reinstalling the application may fix this problem.

however, i checked QCoreApplication.libraryPaths() and i find that the qt5_plugins is in temp folder and program detect it ([u'C:\Users\Madoodia\AppData\Local\Temp_MEI175122\qt5_plugins'])

and i found that pyinstaller have qt5_plugins folder in temp, but not detect it in client system,even it can not detect that i set windows icon to window and don't show it. the dll file related to icon file is "qt5_plugins/imageformats/qico.dll".

app.setWindowIcon(QIcon('icon.ico'))

i really appriciate for any help.

Hartmut Goebel

unread,
Apr 28, 2014, 5:17:18 PM4/28/14
to pyins...@googlegroups.com
Hello,

I'm not used to QT5, so someone else may speak up please. But here are some tips:

This application failed to start because it could not find or load the Qt platform plugin “windows”.

Available platform plugins are: minimal, offscreen, windows.

Reinstalling the application may fix this problem.


For me this seams as if your application finds the "windows" plugiin, but is not able to load it. Maybe some other files are missing.



and i found that pyinstaller have qt5_plugins folder in temp, but not detect it in client system,


According th the message above, it *detects* the plugin: "Available platform plugins are: ... windows."


i really appriciate for any help.

As said, I'm not used to Qt 5. But you may get some more hints at If Thing Go Wrong.


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

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

Blog: http://www.goebel-consult.de/blog/funktioniert-sprachausgabe-inzwischen-brauchbar
Kolumne: http://www.cissp-gefluester.de/2010-11-it-sicherheit-im-unternehmen-eine-interne-oder-externe-angelegenheit

Goebel Consult ist Mitglied bei http://www.7-it.de/

Martin Zibricky

unread,
Apr 29, 2014, 4:21:01 AM4/29/14
to pyins...@googlegroups.com
On Monday 28 of April 2014 03:18:44 Mahmoodreza Aarabi wrote:
> This application failed to start because it could not find or load the Qt
> platform plugin “windows”.

It could be that PyQt5 hooks are not finding some qt plugins and they are not
bundled.

Does --onedir work for you otherwise?
signature.asc

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 4:30:00 AM4/29/14
to pyins...@googlegroups.com
thanks Hartmut
thanks Martin
yes martin, when i create onefolder it works in all systems
and it know qt5_plugins folder and all other files
but in onefile it have problem to know it.and i think it could not detect temp folder
i introduced to it with _MEIPASS
but yet it does not work
i think this is a bug
and now i decide to switch to pyqtdeploy

but if i can get result from pyinstaller i work with it too
i like it
--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 4:31:49 AM4/29/14
to pyins...@googlegroups.com
what is this signature.asc file?
and how should i use it?

can you tell me?
--


Bests,
madoodia

Hartmut Goebel

unread,
Apr 29, 2014, 5:04:01 AM4/29/14
to pyins...@googlegroups.com
Am 29.04.2014 10:31, schrieb Mahmoodreza Aarabi:
what is this signature.asc file?
and how should i use it?

This is an OpenPGP signature for that mail. To verify it, switch from using a Webmail-Frontend to a mail program supporting OpenPGP. I recommend Thunderbird plus Enigmail. In Webfrontents you'll never be able to verify signatures nore to read or write encrypted mails.

(I also suggest not using gmail, yahoo or that like, but this is a different topic.)

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

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

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 5:08:43 AM4/29/14
to pyins...@googlegroups.com
this is related to my question about pyinstaller????
--


Bests,
madoodia

Hartmut Goebel

unread,
Apr 29, 2014, 5:22:33 AM4/29/14
to pyins...@googlegroups.com
Am 29.04.2014 11:08, schrieb Mahmoodreza Aarabi:
this is related to my question about pyinstaller????

No.

But since you asked about this file, I suggest reading <https://en.wikipedia.org/wiki/Openpgp>.


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

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

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 5:23:28 AM4/29/14
to pyins...@googlegroups.com
mhm
please guide me about getting result with pyinstaller (--onefile mode)

i need it
--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 5:46:30 AM4/29/14
to pyins...@googlegroups.com
how should i access to qt5_plugins folder in _MEIxxxx?
and exe file can detect it automatically?
--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 7:17:17 AM4/29/14
to pyins...@googlegroups.com
i find n error in building onefile:
1016 WARNING: No such file C:\Python27\msvcp90.dll
1016 WARNING: Assembly incomplete
1017 ERROR: Assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
not found

do you know it?
--


Bests,
madoodia

Hartmut Goebel

unread,
Apr 29, 2014, 8:44:05 AM4/29/14
to pyins...@googlegroups.com
Am 29.04.2014 13:17, schrieb Mahmoodreza Aarabi:
i find n error in building onefile:
1016 WARNING: No such file C:\Python27\msvcp90.dll
1016 WARNING: Assembly incomplete
1017 ERROR: Assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
not found

do you know it?


Looks as if your machine is missing the msvc redistributable. But I'm not a Windows-User :-)

If you workd through http://www.pyinstaller.org/wiki/FAQ#IfThingsGoWrong, Make sure everything is packaged,
Adapting to being "frozen" and Accessing Data Files, I'm afraid I can not help you anymore. You need to find out, why your Program is not loading the plugin.

And remember: Make it work in --one-dir mode first! This is much easier to debug as you can simple frop files into that directory.

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

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

Mahmoodreza Aarabi

unread,
Apr 29, 2014, 8:49:38 AM4/29/14
to pyins...@googlegroups.com
thanks
i built my PyQt5 with visual studio 2012.
and i install vcredist_x64 2012 on destination system.
but my bro, in onedir mode it works fine,both in my system and clean VM, but when i use onefile mode i have this problem
and i can't tell the exe file that your destination folder is in _MEIPASS.
i have spec file
and qt.conf with this value:
[Paths]
Prefix = .
Plugins = qt5_plugins

(if this have problem please tell me)
but yet it can't know qt5_plugins as plugins folder

--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
May 10, 2014, 2:58:59 PM5/10/14
to pyins...@googlegroups.com
i find the way and i post it on stackoverflow
have a look: http://stackoverflow.com/questions/23446124/solvedbundle-just-onefile

Hartmut Goebel

unread,
May 11, 2014, 8:21:23 AM5/11/14
to pyins...@googlegroups.com
Am 10.05.2014 20:58, schrieb Mahmoodreza Aarabi:
i find the way and i post it on stackoverflow
have a look: http://stackoverflow.com/questions/23446124/solvedbundle-just-onefile

Which of the answers there solves the probleme?

Would you please put the anser into a recipe on www.pyinstaller.org, which is the place most users will search first. Thanks! (Attention: www.pyinstaller.orgv uses Googel Anaylstics)

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

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

Mahmoodreza Aarabi

unread,
May 11, 2014, 8:45:58 AM5/11/14
to pyins...@googlegroups.com
my answer.
what is recipe in pyinstaller?
--


Bests,
madoodia

Hartmut Goebel

unread,
May 11, 2014, 4:00:05 PM5/11/14
to pyins...@googlegroups.com
Am 11.05.2014 14:45, schrieb Mahmoodreza Aarabi:
my answer.
what is recipe in pyinstaller?

Just a collection of useful tips, see http://www.pyinstaller.org/wiki/Recipe

Mahmoodreza Aarabi

unread,
May 11, 2014, 4:01:49 PM5/11/14
to pyins...@googlegroups.com
ok
thanks
--


Bests,
madoodia

Bryan A. Jones

unread,
May 28, 2014, 12:22:30 PM5/28/14
to pyins...@googlegroups.com
...but essentially uneditable. Would the Pyinstaller team consider migrating everything to git (the issue tracker and the wiki) which seems to be a bit easier to edit?
--
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi state, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298

Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)
Reply all
Reply to author
Forward
0 new messages