NaitLee / Cat-Printer

Application supporting Bluetooth thermal “Cat Printers”, for everyone!
GNU General Public License v3.0
307 stars 31 forks source link

Trying to compile to .exe with pypinstaller #103

Open bobitza opened 2 months ago

bobitza commented 2 months ago

Error: ImportError: cannot import name 'i18n' from 'printer Screenshot 2024-05-07 151117

Tried command: pyinstaller --onefile --clean --windowed --debug=all server.py

This is server.spec:

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

a = Analysis(
    ['server.py'],
    pathex=['C:\\Python311\\Scripts', 'C:\\Users\\coman\\Downloads\\Imprimanta-termica-by-bogdan-python\\Cat-Printer-main\\wvenv\\Lib\\site-packages', 'C:\\Python311\\Lib\\site-packages'],
    binaries=[],
    datas=[],
    hiddenimports=['printer', 'i18n'],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=True,
    optimize=1,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [('v', None, 'OPTION')],
    name='server',
    debug=True,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)