天天看點

【問題解決】pyinstaller打包後的exe執行報錯 Failed to execute script main問題:解決:

問題:

Failed to execute script main

【問題解決】pyinstaller打包後的exe執行報錯 Failed to execute script main問題:解決:

原本打包生成的

main.exe

35.4MB

的,現在隻有

3.4MB

打包報錯:

176 INFO: PyInstaller: 3.4
177 INFO: Python: 2.7.9
187 INFO: Platform: Windows-8-6.2.9200
189 INFO: wrote ...
197 INFO: UPX is not available.
199 INFO: Extending PYTHONPATH with paths

...

199 INFO: checking Analysis
256 INFO: checking PYZ
292 INFO: checking PKG
296 INFO: Bootloader C:\Python27\lib\site-packages\pyinstaller-3.4-py2.7.egg\PyInstaller\bootloader\Windows-64bit\runw.exe
296 INFO: checking EXE 
           

解決:

重新下載下傳安裝

PyInstaller

,這裡下載下傳的最新的

4.5.1

版本。

安裝使用參考:PyInstaller 安裝與使用(python打包成exe檔案)

PyInstaller 官網下載下傳

【問題解決】pyinstaller打包後的exe執行報錯 Failed to execute script main問題:解決:
# 進入解壓後的檔案夾安裝
python setup.py install

# 如果提示 Error: Building wheels requires the 'wheel' package. Please `pip install wheel` then try again. 
pip install wheel

# 再重新安裝
python setup.py install

# 重新打包