1

The script runs fine but compiled with pyinstaller throws an error in runtime:

Traceback (most recent call last):
  File "poples.py", line 3, in <module>
ModuleNotFoundError: No module named 'arcade'
[5316] Failed to execute script 'poples' due to unhandled exception!

Arcade(latest version:2.6.15)  is installed on my python folder:
    C:\Users\Sarp\AppData\Local\Programs\Python\Python310\Lib\site-packages
as well as installed in my project virtual enviroment folder

What I did so far:

  • Fresh start: delete venv folder and recreate new

  • using pycharms requirement.txt, I reinstalled all the required packages again

  • I run pyi-makespec inside my project folder:

    pyi-makespec --onefile --windowed --icon=icon.ico poples.py
    
  • Edit the spec file line: hiddenimports=[], to hiddenimports=['arcade'], and console=False to console=True (to see runtime error)

    It looks like this:

    block_cipher = None
    
    a = Analysis(
        ['poples.py'],
        pathex=[],
        binaries=[],
        datas=[],
        hiddenimports=['arcade'],
        hookspath=[],
        hooksconfig={},
        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='poples',
        debug=False,
        bootloader_ignore_signals=False,
        strip=False,
        upx=True,
        upx_exclude=[],
        runtime_tmpdir=None,
        console=True,
        disable_windowed_traceback=False,
        argv_emulation=False,
        target_arch=None,
        codesign_identity=None,
        entitlements_file=None,
        icon='icon.ico',
    )
    
  • run pyinstaller inside my project folder pyinstaller poples.spec

  • run the script through command promt

  • got an error

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Ozzy
  • 21
  • 1
  • Did you look at this? https://api.arcade.academy/en/latest/tutorials/bundling_with_pyinstaller/index.html – Grimmy Jun 11 '22 at 02:36
  • Thanks Grimmy, yes I had been and found no information about modulenotfound. An I did the hiddein imports thing as mentioned. Thx. – Ozzy Jun 11 '22 at 07:57

1 Answers1

0

SOLVED: I always copy pyinstaller.exe to my project folder then run fron there. and it always works for my other projects.. But when I delete pyinstaller from this project folder and run it did the job. but still I don't know why this is the case. Maybe arcade don't like the pyinstaller in my project folder.

Ozzy
  • 21
  • 1