Ticket #400 (new defect)
Bug: adding pyd modules with same name different package.
| Reported by: | esttecb@… | Owned by: | matysek |
|---|---|---|---|
| Priority: | normal | Milestone: | PyInstaller 2.2 |
| Component: | PyInstaller | Version: | 1.5.1 |
| Severity: | major | Keywords: | bug,same,name,modules |
| Cc: | esttecb@… |
Description
This are the pyd files I'm trying to import to my app (I did my own hook to import all of them)
Tree:
main |
-foo1
| |_bar1.pyd | |_bar2.pyd |
-foo2
|_bar1.pyd |_bar2.pyd
So, I have two package (different name: foo1 and foo2) with two modules each (cython modules)... after building (Build.py /path/file.spec), and running my app, I get some exception related to those modules. After digging for a while, I found out that foo1 and foo2 have the same modules, I mean not only the names but they are exactly the same (foo1 was replace by foo2 or viceversa). I can see foo1.bar1.pyd, foo1.bar2.pyd, foo2.bar1.pyd, foo.bar2.pyd inside the temp folder generated after running my application.
I'm importing all those modules dinamically from my app, so I can't change the names.
the hook file is something like:
hiddenimports = [foo1.bar1, foo1.bar2, foo2.bar1, foo2.bar2]
Actually, I added the imports to hook-gtk.py, I didn't make my own hook.

The tree is more like this, btw:
foo -> foo1 -> bar1, bar2
foo -> foo2 -> bar1, bar2
I found a workaround to this issue, I'm adding my pyd extensions like this:
rename foo -> foo1 -> bar1, bar2 files to foo -> foo1 -> bar1_a, bar2_b
hook (don't know if this is necessary):
spec file:
... exe = EXE( pyz, a.scripts, ... [ ('foo.foo1.bar1', os.path.join(HOMEPATH,'app\\foo\\foo1\\bar1_a.pyd'),'EXTENSION'), ('foo.foo1.bar2', os.path.join(HOMEPATH,'app\\foo\\foo1\\bar2_a.pyd'),'EXTENSION'), ('foo.foo2.bar1', os.path.join(HOMEPATH,'app\\foo\\foo2\\bar1.pyd'),'EXTENSION'), ('foo.foo2.bar2', os.path.join(HOMEPATH,'app\\foo\\foo2\\bar2.pyd'),'EXTENSION'), ], a.zipfiles, a.datas, ...So, as I supposed the issue has something to do with having modules/extensions named the same, something is messing them up when building.