--- tags: work --- # Pyinstaller輸出cefpython專案 ## Relative Package ``` install with pip3 Package Version ----------------- --------- pycrypto 2.6.1 PyInstaller 3.6 wheel 0.34.2 ``` ## 小姿識 1. 若在64位元win10底下輸出應該是可以向下支援BUT如果在32位元win10下就只能在32位元系統執行。 2. 在下載pycrypto時有99.99%會吃屎,解法請見[這篇](https://hackmd.io/h5twY16PSwS6J-q51k0mqg) ## 我使用的檔案架構 ``` dir/ app.py=============>欲輸出之程式 pyinstaller.py=====>Pyinstaller主程式 pyinstaller.spec===>pyinstaller設定檔 hook-cefpython3.py=>help to find CEF Python dependencies ``` #### pyinstaller.spec 設定 ``` a = Analysis( ["你要輸出的程式.py"], hookspath=["."], # To find "hook-cefpython3.py" cipher=cipher_obj, win_private_assemblies=True, win_no_prefer_redirects=True, ) ``` ``` exe = EXE(pyz, a.scripts, exclude_binaries=True, name="cefapp", debug=DEBUG, strip=False, upx=False, console=DEBUG, icon="程式的圖片.ico") ``` ## 開始輸出 ``` python3 pyinstaller.py ``` #### 若有bug用這個查看詳細資訊 ``` python pyinstaller.py --debug ``` ## Reference [README-pyinstaller.md](https://github.com/cztomczak/cefpython/blob/master/examples/pyinstaller/README-pyinstaller.md)