Error MERGE spec file (multipackage bundle)

8 views
Skip to first unread message

Thomas

unread,
Jun 13, 2021, 2:39:51 PM6/13/21
to PyInstaller
Hi everybody,

I followed the instructions in the doc for a multipackage (calling the MERGE method in the spec file). The building went smooth and, as expected, the second package doesn't have the shared dependencies... In fact it does not work! :)

Error loading Python DLL 'path/2nd/package/python38.dll'
LoadLibrary: The specified module could not be found

If I reverse the order of the MERGE arguments, then is the other package that is not working. So the dependencies are not shared.

I'm on version 4.3, here's my .spec:

# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


files_D = [('src_D-QSAR/static/*.*', 'static'),
        # ('_DATABASES/*.*', '_DATABASES'),
         ('src_D-QSAR/templates/*.*', 'templates'),
        ] 

files_Q = [ # ('COPYING.txt', '.'),
       #  ('QSARpy2_Manual.html', '.'),
       #  ('QSARpy2_Manual.pdf', '.'),
         ('src_QSARpy/pics/*.*', 'pics'),
       #  ('_DATASETS/*.*', '_DATASETS'),
        ]  

OB_libs = [('src_QSARpy/OB_libs/*.dll', '.'),
           ('src_QSARpy/OB_libs/*.obf', '.'),
           ]

DQSAR_a = Analysis(['src_D-QSAR/D-QSAR.py'],
             pathex=[],  # add to pythonpath  (the path of the .py is added automatically)
             binaries=[],
             datas=files_D,
             hiddenimports=[],
             hookspath=['.'],  # add local hooks
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)


QSARpy_a = Analysis(['src_QSARpy/QSARpy_GUI.py'],
             pathex=[],
             binaries=OB_libs,
             datas=files_Q,
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)

MERGE( (QSARpy_a, 'QSARpy_GUI', 'QSARpy2'), (DQSAR_a, 'D-QSAR', 'D-QSAR'), )


DQSAR_pyz = PYZ(DQSAR_a.pure, 
                 DQSAR_a.zipped_data,
                 cipher=block_cipher)

DQSAR_exe = EXE(DQSAR_pyz,
                 DQSAR_a.scripts,
                 [],
                 exclude_binaries=True,
                 name='D-QSAR',                             # .exe
                 debug=False,
                 bootloader_ignore_signals=False,
                 strip=False,
                 upx=True,
                 console=True,
                 icon='src_D-QSAR/static/D-QSAR.ico', )

DQSAR_coll = COLLECT(DQSAR_exe,
                      DQSAR_a.binaries,
                      DQSAR_a.zipfiles,
                      DQSAR_a.datas,
                      strip=False,
                      upx=True,
                      upx_exclude=[],
                      name='D-QSAR_pyinstaller')            # directory



QSARpy_pyz = PYZ(QSARpy_a.pure,
                 QSARpy_a.zipped_data,
                 cipher=block_cipher)

QSARpy_exe = EXE(QSARpy_pyz,
                 QSARpy_a.scripts,
                 [],
                 exclude_binaries=True,
                 name='QSARpy2',
                 debug=False,
                 bootloader_ignore_signals=False,
                 strip=False,
                 upx=True,
                 console=True,
                 icon='src_QSARpy/pics/QSARpy.ico', )

QSARpy_coll = COLLECT(QSARpy_exe,
                      QSARpy_a.binaries,
                      QSARpy_a.zipfiles,
                      QSARpy_a.datas,
                      strip=False,
                      upx=True,
                      upx_exclude=[],
                      name='QSARpy2_pyinstaller')
Reply all
Reply to author
Forward
0 new messages