PyInstaller creating qt.conf file in the .exe folder

828 views
Skip to first unread message

Laurence Anthony

unread,
Aug 27, 2015, 1:22:48 PM8/27/15
to pyins...@googlegroups.com
Hi,

I recently updated to WinPython 32-bit (python-2.7.10 + PyQt  4.11.4) and WinPython 64-bit versions (python-2.7.10.amd64 + PyQt  4.11.4).

Since updating, when I create a one-file or one-dir frozen app with PyInstaller, on running the frozen app, a qt.conf file gets created in the folder containing the .exe file. The contents of the qt.conf are as follows:

[Paths]
Prefix = C:/Users/Anthony/AppData/Local/Temp/_MEI9762/PyQt4
Binaries = C:/Users/Anthony/AppData/Local/Temp/_MEI9762/PyQt4

Here is my test script:

import sys
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
win = QtGui.QPushButton("Hello World!")
win.show()
sys.exit(app.exec_())

With a one-dir option, this is fine, because the .exe is in the frozen app folder so the user doesn't notice. However, with the one-file option, a new qt.conf gets created alongside the .exe, which the user will see (and probably not understand).

For now, I'm using a hack to delete the qt.conf file that gets created via os.remove('qt.conf'), but is there a way to direct PyInstaller to send the qt.conf to a temp folder (e.g. sys._MEIPASS) or not produce it at all. 

I didn't have this problem until I updated to the latest version of PyQt, so is this just a problem with recent versions of PyQt or QT causing PyInstaller to get confused about the qt.conf file?

Laurence.

Martin Zibricky

unread,
Aug 27, 2015, 2:19:52 PM8/27/15
to pyins...@googlegroups.com
On Friday 28 of August 2015 02:22:08 Laurence Anthony wrote:
> I didn't have this problem until I updated to the latest version of PyQt,
> so is this just a problem with recent versions of PyQt or QT causing
> PyInstaller to get confused about the qt.conf file?
>
> Laurence.

Hi,

What PyInstaller version do you use?
signature.asc

Laurence Anthony

unread,
Aug 27, 2015, 8:14:00 PM8/27/15
to pyins...@googlegroups.com

Sorry, I should have said.
I'm  using the latest development version.

Laurence

--
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...@googlegroups.com.
To post to this group, send email to pyins...@googlegroups.com.
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Martin Zibricky

unread,
Aug 28, 2015, 9:49:18 AM8/28/15
to pyins...@googlegroups.com
On Friday 28 of August 2015 09:13:58 Laurence Anthony wrote:
> Sorry, I should have said.
> I'm using the latest development version.

Please try the 'python3' branch. It already works with Python 2 and we make
changes only in this branch.
signature.asc

Laurence Anthony

unread,
Aug 28, 2015, 11:54:26 AM8/28/15
to pyins...@googlegroups.com
Hi,

Thank you for the quick response. I tested the python3 branch of PyInstaller with both the WinPython 32-bit (python-2.7.10 + PyQt  4.11.4) and WinPython 64-bit versions (python-2.7.10.amd64 + PyQt  4.11.4). Unfortunately, no change at all. I'm still getting the qt.conf file generated in the .exe folder. Here is the contents of the one-file qt.conf file.

[Paths]
Prefix = C:/Users/Anthony/AppData/Local/Temp/_MEI64922/PyQt4
Binaries = C:/Users/Anthony/AppData/Local/Temp/_MEI64922/PyQt4

Any suggestions?

Laurence




###############################################################
Laurence ANTHONY, Ph.D.
Professor
Center for English Language Education in Science and Engineering (CELESE)
Faculty of Science and Engineering
Waseda University
3-4-1 Okubo, Shinjuku-ku, Tokyo 169-8555, Japan
E-mail: antho...@gmail.com
WWW: http://www.laurenceanthony.net/
###############################################################

Martin Zibricky

unread,
Aug 28, 2015, 6:45:04 PM8/28/15
to pyins...@googlegroups.com
On Saturday 29 of August 2015 00:53:45 Laurence Anthony wrote:
> Thank you for the quick response. I tested the python3 branch of
> PyInstaller with both the WinPython 32-bit (python-2.7.10 + PyQt 4.11.4)
> and WinPython 64-bit versions (python-2.7.10.amd64 + PyQt 4.11.4).
> Unfortunately, no change at all. I'm still getting the qt.conf file
> generated in the .exe folder. Here is the contents of the one-file qt.conf
> file.

Do you have any simple code example to reproduce?

What distribution of Python is 'WinPython'? Is it the standard CPython from
python.org?
signature.asc

Laurence Anthony

unread,
Aug 29, 2015, 1:37:36 AM8/29/15
to pyins...@googlegroups.com
Hi,

As I wrote in my first post, here is the test script I am using:

import sys
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
win = QtGui.QPushButton("Hello World!")
win.show()
sys.exit(app.exec_())

WinPython uses the latest CPython. As I wrote, it is python-2.7.10 (32-bit) or python-2.7.10.amd64 (64-bit).

Laurence.



###############################################################
Laurence ANTHONY, Ph.D.
Professor
Center for English Language Education in Science and Engineering (CELESE)
Faculty of Science and Engineering
Waseda University
3-4-1 Okubo, Shinjuku-ku, Tokyo 169-8555, Japan
E-mail: antho...@gmail.com
WWW: http://www.laurenceanthony.net/
###############################################################

Martin Zibricky

unread,
Aug 29, 2015, 4:27:15 AM8/29/15
to pyins...@googlegroups.com
One more thing to try is
* Download Python 2.7.10 from python.org and install it.
* Download PyQt4 from https://riverbankcomputing.com and install it.

I guess WinPython packaging is doing some magic in the background.
signature.asc

Laurence Anthony

unread,
Aug 30, 2015, 12:43:09 AM8/30/15
to pyins...@googlegroups.com
Hi again,

Thanks for the suggestion. I might speak to the PyQt community to find out where exactly the qt.conf is being created and see if I can redirect it. I'll report back here if I have any success.

Laurence.



###############################################################
Laurence ANTHONY, Ph.D.
Professor
Center for English Language Education in Science and Engineering (CELESE)
Faculty of Science and Engineering
Waseda University
3-4-1 Okubo, Shinjuku-ku, Tokyo 169-8555, Japan
E-mail: antho...@gmail.com
WWW: http://www.laurenceanthony.net/
###############################################################

Laurence Anthony

unread,
Sep 8, 2015, 9:11:36 AM9/8/15
to pyins...@googlegroups.com
Just to report back on what I found: 

I tried Python 2.7.10 from python.org and PyQT4 from riverbank. Same problem as before. A qt.conf file is created in the same folder as the .exe created by PyInstaller. I'm now lost for ideas. 

Here's my test script (again):
import sys
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
win = QtGui.QPushButton("Hello World!")
win.show()
sys.exit(app.exec_())

Laurence.

Hartmut Goebel

unread,
Sep 8, 2015, 10:18:37 AM9/8/15
to pyins...@googlegroups.com
Am 08.09.2015 um 15:10 schrieb Laurence Anthony:
Same problem as before. A qt.conf file is created in the same folder as the .exe created by PyInstaller.

I just grepped the source of PyInstaller, "qt.conf" does not occur there. So the file is not actively created by PyInstaller. And I was not able to reproduce this. On my system (Linux), no qt.conf file is here in either cases.

If in onefile the file is put beside the .exe, this means either:
  1. the spec-file contains a COLLECT() part (which means you have a hand.crafted spec-file, which basically is okay
  2. Something else creates the qt.conf file.
In the later case you may try one of the too mentioned in https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly (e.g. STraceNT) to track this down.

--
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/feiertagsarbeit-bei-teletrust
Kolumne: http://www.cissp-gefluester.de/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht

Laurence Anthony

unread,
Sep 9, 2015, 3:20:13 AM9/9/15
to pyins...@googlegroups.com
Hi again,

I was running my test file using >pyinstaller text.py. So, no spec-file or anything fancy. However, I have an interesting update. The qt.conf file is being created on stock Python and also WinPython. But it isn't created when using Anaconda Python. So, there is definitely some 'magic' happening Anaconda. I just don't know what it is.

Anyway, a workaround is to use the hack I described earlier to delete the qt.conf file, or just use Anaconda.

I hope that's useful for others experiencing the same problem.



--
Reply all
Reply to author
Forward
0 new messages