[Python] pyinstaller unable to create .exe file

Discussão em 'Python' iniciado por Stack, Fevereiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to create a .exe file from my python-folium script (using pyinstaller).
    Somehow it doesn't create the .exe file when executing pyinstaller.

    After some googling, most of solution similar with Branca Python module is unable to find 2 essential json files when running an executable that uses folium

    But somehow i get this error, with that solution:

    4526 INFO: Appending 'datas' from .spec

    Unable to find "venv\Lib\site-packages\branca\*.json" when adding binary and data files.


    Any advice?

    this my .spec file

    block_cipher = None


    a = Analysis(['main.py'],
    pathex=['C:\\Users\\my\\py\\system'],
    binaries=[],
    datas=[
    (".\\venv\\Lib\\site-packages\\branca\\*.json","branca"),
    (".\\venv\\Lib\\site-packages\\branca\\templates","templates"),
    (".\\venv\\Lib\\site-packages\\folium\\templates","templates"),
    ],
    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,
    runtime_tmpdir=None,
    console=True )

    Continue reading...

Compartilhe esta Página