pyqt5打包exe 自行添加dll

使用pyinstaller 生成响应的.spec文件,如下是文件的内容。只需要在binaries=[('I:\\pyqt5\\video2image_app_v3.3\\opencv_ffmpeg342_64.dll','.')],加上自己的dll路径即可,然后执行pyinstaller -F xx.spec --noconsole

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

block_cipher = None


a = Analysis(['main.py'],
             pathex=['I:\\pyqt5\\video2image_app_v3.3'],
             binaries=[('I:\\pyqt5\\video2image_app_v3.3\\opencv_ffmpeg342_64.dll','.')],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='main',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False )

 

你可能感兴趣的:(Python)