天天看点

【问题解决】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

# 重新打包