1. 程式人生 > >pyinstaller打包人臉識別程式,帶介面--過坑

pyinstaller打包人臉識別程式,帶介面--過坑

1.fail to execute XXX

使用

import traceback
try:
    import face_recognition
except Exception as e:
    traceback.print_exc(file=open('error.log', 'w+'))

發現錯誤

RuntimeError: Unable to open D:\python3.6.2\Lib\site-packages\face_recognition_models\models\shape_predictor_68_face_landmarks.dat

2.思考到是該包沒有打包,檢視官方文件

Analysis:
  • scripts: the python scripts named on the command line;命令列上命名的python指令碼
  • pure: pure python modules needed by the scripts;指令碼所需的純python模組;
  • binaries: non-python modules needed by the scripts;指令碼所需的非python模組;
  • datas: non-binary files included in the app。指令碼所需的非二進位制模組,如圖示等資源;
face_recognition_models是的程式成功執行。

結果示範

: