Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #400 (new defect)

Opened 22 months ago

Last modified 3 weeks ago

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.

Attachments

Change History

comment:1 Changed 21 months ago by esttecb@…

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):

hiddenimports = [foo.foo1, foo.foo2]

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.

comment:2 Changed 21 months ago by matysek

  • Milestone set to PyInstaller 1.5.2

comment:3 Changed 14 months ago by matysek

  • Milestone PyInstaller 1.5.2 deleted

comment:4 Changed 9 months ago by matysek

  • Milestone set to PyInstaller 2.1

comment:5 Changed 9 months ago by matysek

  • Priority changed from high to normal

comment:6 Changed 3 weeks ago by matysek

  • Milestone changed from PyInstaller 2.1 to PyInstaller 2.2

I think this could be solved when using modulegraph library: see #439

View

Add a comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.