# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['main.py','UI\\utils.py','UI\\menu.py','UI\\registration.py','showplot.py',
'sqlite3Helper.py','time_recorder.py','faceHelper.py','face_recognition\\api.py',
'menu_rc.py'],
pathex=['D:\\cs003-Face-cognition-Sign-In-System'],
binaries=[('D:\\python 3.9\\Lib\\site-packages\\face_recognition_models\\models\\*','face_recognition_models\\models')],
datas=[('D:\\python 3.9\\Lib\\site-packages\\face_recognition_models\\models\\*','face_recognition_models\\models')],
hiddenimports=['UI.menu', 'UI.registration', 'UI.utils', 'face_recognition.api',
'showplot','sqlite3Helper','time_recorder','faceHelper','menu_rc'],
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='face',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None , icon='UI\\resources\\logo_round.ico')
Context
Using pyinstaller to package multiple python files including self-defined dependences and model data file
Usage tool
pyinstaller
.specin your root directoryor
Individual configuration
How to implement the script file
.spec:Pay attention to the arguments datas , binaries and hiddenimports in Analysis. If you use default configuration without adding these params or only input valid '.dat' in binaries, there are some errors :
or
Because the api.py uses the dlib to load model dataset in corresponding
site-packageRun
.specand generatebuildanddistdirectory in the root, the.exefile is indistRelease
version : v1.0-alpha
Reference