0

我正在尝试使用 PyInstaller 4 升级为 Windows 构建可执行文件。我可以构建可执行文件,但是当我导入 QsciScintilla 时,它不起作用。我按照他们的教程并尝试使用隐藏导入,我不知道如何修复它。我一直在使用 Python 3.5.4 进行开发。这是我得到的错误:

newnev\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 621, in exec_module
    exec(bytecode, module.__dict__)
  File "Window.py", line 10, in <module>
    from PyQt5.Qsci import QsciScintilla
ImportError: No module named 'PyQt5.Qsci'
[1016] Failed to execute script Interface

用过的:

pyinstaller --onefile --windowed Window.py
pyinstaller --onefile Window.py
pyinstaller --hidden-import=PyQt5.Qsci --onefile Window.py
pyinstaller --hiddenimport=PyQt5.Qsci --onefile Window.py
even with Pyhton -m PyInstaller --onefile --windowed Window.py

这是我使用 pyinstaller --onefile --windowed Interface.py 找到的 .spec 文件

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

block_cipher = None


a = Analysis(['Interface.py'],
             pathex=['C:\\Users\\sasah\\Desktop\\Example'],
             binaries=[],
             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='Interface',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False )

我不知道如何绕过问题并构建运行的脚本。

4

0 回答 0