I've just added a new feature to PyInstaller: a module hook is now able
to specify additional data files that are needed for the module to work
correctly. Those data files are automatically collected when using
--onedir, or bundled within the executable when using --onefile (and
automatically extracted into the temporary dir at startup).
Using this support, I've improved PyQt4's import hooks so that Qt
plugins (such as imageformats, codecs, etc.) are automatically handled
by PyInstaller. IOW, this is now fully transparent to PyInstaller users:
just run PyInstaller trunk and enjoy your multi-platform bundles of PyQt
applications without having to take care of plugins manually.
NOTE: you will need to regenerate your .spec files for this new feature
to work.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
It's basically a false positive.
PyInstaller now automatically handles ctypes dependencies (eg: if you
use ctypes to access a custom dynamic library, it will be automatically
bundled by PyInstaller).
We're planning some ways to whitelist spurious PyInstaller warnings at
least in Python's own standard library.
It looks like PyQt's installer installs a qt.conf file specifying the
plugin paths. Can you find a way to query that directory without having
to parse qt.conf?
> On 2/27/2009 3:21 PM, Antonio Valentino wrote:
>>
>> On 23 Feb, 12:33, Giovanni Bajo <ra...@develer.com> wrote:
>>> Hello,
>>>
>>> I've just added a new feature to PyInstaller: a module hook is now able
>>> to specify additional data files that are needed for the module to work
>>> correctly. Those data files are automatically collected when using
[cut]
>>
>> Hi Giovanni,
>> I'm trying the new pyinstaller-trunk on my PyQt based project.
>> The new hoks seems to fail collecting Qt4 plugins because
>>
>> hooks.hookutils.qt4_plugins_dir()
>>
>> returns
>>
>> "C:\Qt\4.4.1\plugins"
>>
>>
>> while the correct plugins location on my system is
>>
>> "C:\Python25\Lib\site-packages\PyQt4\plugins"
>>
>> I don't have Qt4 installed. I just used the standard PyQt4 installer
>> provided by riverback.
>> It seems to me a PyQt4 build issue and i can't figure out wich is the
>> best approach to solve this problem.
>>
>> Do you have any idea?
>
> It looks like PyQt's installer installs a qt.conf file specifying the
> plugin paths. Can you find a way to query that directory without having
> to parse qt.conf?
Giovanni,
I don't know how to perform that query. Maybe I could ask on the pyqt
mailing list.
Anyway qt.path is (on my PC) in
C:\Python25\Lib\site-packages\PyQt4
so I guess i could use something like
In [5]: PyQt4.__file__
Out[5]: 'C:\\Python25\\lib\\site-packages\\PyQt4\\__init__.pyc'
In [6]: PyQt4.__path__
Out[6]: ['C:\\Python25\\lib\\site-packages\\PyQt4']
to build the path.
I don't know if that is the standard place where qt.conf is put.
The content of the file is
[Paths]
Prefix = C:/Python25/Lib/site-packages/PyQt4
Binaries = .
so it shouldn't be a problem to parse it.
Why do you prefer avoid parsing?
ciao
--
Antonio VALENTINO
Because the point is that I should ask Qt (through PyQt) where the
plugins are; otherwise, PyInstaller's hooks would have to reproduce all
the logic that Qt does to discover possible plugin paths (which are
arbitrarly complex, vary arbitrarly through versions, etc.). I don't
want to duplicate all that code: there must be a way to ask Qt where it
is looking for plugins.
I'll investigate further.
Giovanni,
if my understanding of
http://doc.trolltech.com/4.4/qt-conf.html
is correct the "way to ask Qt where it is looking for plugins" exists
and it is exactly the one you used in hookutils.
The problem is, IMHO, that something is broken somewhere so the best we
can do is detect the failure and try some sort of workaroud.
> I'll investigate further.
--
Antonio Valentino