0

I am trying build executable file for windows using PyInstaller 4 upgrade. I can build the executable file but when I am importing QsciScintilla, it doesn't work. I followed their tutorial and tried to use hidden import as well, I don't know how to fix it. I have been using Python 3.5.4 for development. Here is the error which I am getting:

"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

have used:

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 Python -m PyInstaller --onefile --windowed Window.py.

Here is the .spec file which I found using pyinstaller --onefile --windowed Interface.py

# -*- 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 )

I don't know how to bypass the issues and build the script running.

Misinahaiya
  • 502
  • 2
  • 17
Santosh
  • 27
  • 6
  • show your .spec – eyllanesc Jul 29 '19 at 00:11
  • @eyllanesc Thanks a lot for the correction and your message. Here is the copy of the .spec file which was achieved user pyinstaller --onefile --windowed Interface.py: – Santosh Jul 29 '19 at 13:17
  • # -*- 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) – Santosh Jul 29 '19 at 13:21
  • 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 ) – Santosh Jul 29 '19 at 13:22
  • Sorry, I had to post them in part as it was long for the comment. Please let me know, how to fix this issue. Thanks a lot. – Santosh Jul 29 '19 at 13:23
  • Do not put code in the comments since it is horrible, instead edit your question – eyllanesc Jul 29 '19 at 13:25
  • Alright. Thanks. I will update it. – Santosh Jul 29 '19 at 13:37
  • @eyllanesc Please have a look. I just posted .spec file. Thanks a lot. – Santosh Jul 29 '19 at 13:43
  • change to `hiddenimports=["PyQt5.Qsci"]` in Interface.spec and then execute `pyinstaller Interface.spec` – eyllanesc Jul 29 '19 at 13:47
  • @eyllanesc You mean just to perform that task or something else as well. I tried that way and it didn't work. I also had tried pyinstaller --hiddenimport=PyQt5.Qsci --onefile --windowed Interface.py and it fills the same information there. But, it didn't work.I don't know what's happening here. It is supposed to work. – Santosh Jul 29 '19 at 14:00
  • Show me the `interface.py` file. – Misinahaiya Aug 27 '23 at 11:06

0 Answers0