Sorry, I had disabled the tables hooks for an alternative build.
This is what I get when enabling the hiddenimports again:
zipimport not found readline
..found None when looking for readline
(Pdb) l
493 importfunc = parent.__importsub__ =
subimporter.getmod
494 debug("using parent's importfunc: %s" % importfunc)
495 mod = importfunc(nm)
496 if nm == '_comp_lzo':
497 import pdb;pdb.set_trace()
498 -> if mod and not reload:
499 setattr(parent, nm, mod)
500 else:
501 debug("..parent not a package")
502 return None
503 else:
(Pdb) mod
<module 'tables._comp_lzo' from
'C:\Data\simo\dev\pyinstaller\dist\bin\tables._comp_lzo.pyd'>
(Pdb) reload
0
so yes, setattr is executed on
(Pdb) parent
<module 'tables' from
'C:\Data\simo\dev\pyinstaller\build\pyi.win32\simo_onedir\outPYZ11.pyz/tables'>
But despite that, the end result is
zipimport not found readline
..found None when looking for readline
..found <module 'tables._comp_lzo' from
'C:\Data\simo\dev\pyinstaller\dist\bin\tables._comp_lzo.pyd'> when
looking for tables._comp_lzo
importHook done with tables._comp_lzo tables.utilsExtension [] (case 3)
Traceback (most recent call last):
File "<string>", line 27, in <module>
File "c:\pyinstaller\iu.py", line 436, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "c:\pyinstaller\iu.py", line 523, in doimport
exec co in mod.__dict__
File
"C:\Data\simo\dev\pyinstaller\build\pyi.win32\simo_onedir\outPYZ11.pyz/simo.optimization.genetic_algorithm",
line 19, in <module>
File "c:\pyinstaller\iu.py", line 436, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "c:\pyinstaller\iu.py", line 523, in doimport
exec co in mod.__dict__
File
"C:\Data\simo\dev\pyinstaller\build\pyi.win32\simo_onedir\outPYZ11.pyz/simo.optimization.optimizer",
line 19, in <module>
File "c:\pyinstaller\iu.py", line 436, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "c:\pyinstaller\iu.py", line 523, in doimport
exec co in mod.__dict__
File
"C:\Data\simo\dev\pyinstaller\build\pyi.win32\simo_onedir\outPYZ11.pyz/simo.optimization.tools.omatrix",
line 22, in <module>
File "c:\pyinstaller\iu.py", line 436, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "c:\pyinstaller\iu.py", line 523, in doimport
exec co in mod.__dict__
File
"C:\Data\simo\dev\pyinstaller\build\pyi.win32\simo_onedir\outPYZ11.pyz/tables",
line 56, in <module>
File "c:\pyinstaller\iu.py", line 436, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "c:\pyinstaller\iu.py", line 495, in doimport
mod = importfunc(nm)
File "c:\pyinstaller\iu.py", line 297, in getmod
mod = owner.getmod(nm)
File "C:\pyinstaller\archive.py", line 468, in getmod
return iu.DirOwner.getmod(self, self.prefix+'.'+nm)
File "c:\pyinstaller\iu.py", line 109, in getmod
mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
File "utilsExtension.pyx", line 100, in tables.utilsExtension
AttributeError: 'module' object has no attribute '_comp_lzo'
RC: -1 from runner
2010/5/17 Jussi Rasinmäki <[email protected]>:
> On 17 May 2010 15:25, Giovanni Bajo <[email protected]> wrote:
>> On 5/17/2010 9:10 AM, jrasinma wrote:
>>>
>>> and just to clarify the issue further: to me it seems that the problem
>>> is that an extension (_comp_lzo.pyd) is imported from within another
>>> extension (utilsExtension.pyd, generated with Pyrex from
>>> utilsExtension.pyx). Hence, eventhough tables._comp_lzo.pyd exists in
>>> the root directory of onedir build, it's not seen by
>>> tables.utilsExtension.pyd in the same directory?
>>
>> Uhm, no, the scenario you describe you should work correctly. Notice also
>> that _comp_lzo is correctly imported, given the iu log:
>>
>> trying _comp_lzo tables tables._comp_lzo
>> doimport(_comp_lzo, tables, tables._comp_lzo)
>> using parent's importfunc: <bound method PathImportDirector.getmod of
>> <iu.PathImportDirector instance at 0x01276878>>
>> ..found <module 'tables._comp_lzo' from
>> 'C:\Data\simo\dev\pyinstaller\dist\bin\tables._comp_lzo.pyd'> when
>> looking for tables._comp_lzo
>> importHook done with tables._comp_lzo tables.utilsExtension [] (case 3)
>>
>> So the real issue here is why "_comp_lzo" is not added to "tables"'
>> dictionary, even though it is correctly imported.
>>
>> The setattr() happens around line 497 of iu.py:
>>
>> debug("using parent's importfunc: %s" % importfunc)
>> mod = importfunc(nm)
>> if mod and not reload:
>> setattr(parent, nm, mod)
>>
>> Can you please check that it is executed? It should do something like:
>>
>> setattr(tables_module, "_comp_lzo", complzo_module)
>
> When having a breakpoint like this:
>
> 496 if nm == '_comp_lzo':
> 497 import pdb;pdb.set_trace()
> 498 -> if mod and not reload:
>
> the breakpoint is reached once and then mod is None
>
>> PS: I can't help because it looks like I can't install pytables correctly:
>>
>> Traceback (most recent call last):
>> File "tabtest.py", line 1, in <module>
>> import tables
>> File "C:\python25\lib\site-packages\tables\__init__.py", line 56, in
>> <module>
>> from tables.utilsExtension import getPyTablesVersion, getHDF5Version
>> File "definitions.pxd", line 138, in tables.utilsExtension
>> ValueError: numpy.dtype does not appear to be the correct type object
>>
>> Maybe you have a clue about this? I simply installed the latest pytables and
>> numpy in a python25 Windows installation.
>
> Oh yes, the latest PyTables release is not compatible with the latest
> Numpy release, as Numpy has had some backwards incompatible changes:
> This combo should work: PyTables == 2.1.2 (the latest), Numpy == 1.3.0
>
> Cheers,
> Jussi
>
>> --
>> Giovanni Bajo
>> Develer S.r.l.
>> http://www.develer.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PyInstaller" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/pyinstaller?hl=en.
>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.