做了一个生成二维码的小程序:http://www.cnblogs.com/dcb3688/p/4241048.html

直接运行脚本没问题,用pyinstaller打包后再运行就直接报错了:

应用程序无法启动 因为程序的并行配置不正确。有关详细信息,请参阅应用程序事件日志,或使用命令行 sxstrace.exe 工具。

网上找的解决方法:

1.   安装Microsoft Visual C++ 2008 Redistributable

2.  开始 - 运行(输入services.msc)- 确定或回车,打开:服务(本地),开启Windows Modules Installer服务

第一种,我电脑已经安装VC2008,且VC2005 和VC2010 都安装了,  排除!

第二种,打开本地服务,发现Windows Modules Installer  已经是开启的, 排除!

所以还是在打包的信息中寻找线索吧

找打包时的信息分析后发现:

 19753 INFO: Looking for run-time hooks
19754 INFO: Analyzing rthook C:\Python27\lib\site-packages\pyinstaller-2.1.1.dev0-py2.7.egg\PyInstaller\loader\rthooks\pyi_rth_qt4plugins.py
19845 INFO: Analyzing rthook C:\Python27\lib\site-packages\pyinstaller-2.1.1.dev0-py2.7.egg\PyInstaller\loader\rthooks\pyi_rth_PIL_Image.py
19954 INFO: Analyzing rthook C:\Python27\lib\site-packages\pyinstaller-2.1.1.dev0-py2.7.egg\PyInstaller\loader\rthooks\pyi_rth_Image.py
22815 INFO: Adding Microsoft.VC90.DebugCRT to dependent assemblies of final executable
22894 INFO: Searching for assembly x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
22894 WARNING: Assembly not found
22894 ERROR: Assembly x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
23014 INFO: Searching for assembly x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...

是缺少VC90.CRT,但在系统中是可以找的到的:

 608 INFO: wrote E:\www\pyqt\TEST\qrcode_a.spec
684 INFO: Testing for ability to set icons, version resources...
888 INFO: ... resource update available
892 INFO: UPX is not available.
1000 INFO: Processing hook hook-os
1273 INFO: Processing hook hook-time
1279 INFO: Processing hook hook-cPickle
1434 INFO: Processing hook hook-_sre
1914 INFO: Processing hook hook-cStringIO
2136 INFO: Processing hook hook-encodings
2161 INFO: Processing hook hook-codecs
4158 INFO: Extending PYTHONPATH with E:\www\pyqt\TEST
4161 INFO: checking Analysis
4161 INFO: Building Analysis because out00-Analysis.toc non existent
4161 INFO: running Analysis out00-Analysis.toc
4162 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
11481 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
11485 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest
11508 INFO: Searching for file msvcr90.dll
11509 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll
11510 INFO: Searching for file msvcp90.dll
11511 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll
11513 INFO: Searching for file msvcm90.dll
11513 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll
11827 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1.1.dev0-py2.7.egg\PyInstaller\loader\_pyi_bootstrap.py

突然发现程序找的依赖DLL不是x86_microsoft.vc90.CRT  而是   x86_Microsoft.VC90.DebugCRT , 应该是debug调试模式运行

网上找来找去也没有找到x86_Microsoft.VC90.DebugCRT.dll 的下载地址

 在看看Pyinstaller里面的参数说明:

----------------------------------------------------------------------------------------------------------

-F, --onefile Py代码只有一个文件

-D, --onedir Py代码放在一个目录中(默认是这个)

-K, --tk 包含TCL/TK

-d, --debug 生成debug模式的exe文件

-w, --windowed, --noconsole 窗体exe文件(Windows Only)

-c, --nowindowed, --console 控制台exe文件(Windows Only)

-o DIR, --out=DIR 设置spec文件输出的目录,默认在PyInstaller同目录

--icon=<FILE.ICO> 加入图标(Windows Only)

-v FILE, --version=FILE 加入版本信息文件

----------------------------------------------------------------------------------------------------------

我打包的时候是不带有-d参数的,所以不知道这里的debug是否为pyinstaller里面所指的debug, 我试着加上参数-d ,打包信息中还是出现:

 22894 ERROR: Assembly x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
23014 INFO: Searching for assembly x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
23014 WARNING: Assembly not found

带与不带参数-d效果一样!

没办法只能查看pyinstaller生成的文件吧,这一看还是没找到问题,但看到了解决办法

在build目录里面有个.manifest文件

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="qrcode_a" processorArchitecture="x86" type="win32" version="1.0.0.0"/>
<dependency>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" type="win32" version="9.0.21022.8"/>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VC90.DebugCRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" type="win32" version="9.0.21022.8"/>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity language="*" name="Microsoft.Windows.Common-Controls" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" type="win32" version="6.0.0.0"/>
</dependentAssembly>
</dependency>
</assembly>

果然看到:Microsoft.VC90.DebugCRT

解决办法:

将.manifest文件中    Microsoft.VC90.DebugCRT      改为     Microsoft.VC90.CRT  

在打包运行,一切OK!

但为什么会出现debug模式,我还是没找到问题。

解决Pyqt打包后运行报错:应用程序无法启动 因为程序的并行配置不正确的更多相关文章

  1. vue项目打包后运行报错400如何解决

    昨天一个Vue项目打包后,今天测试,发现无论localhost还是服务器上都运行不了,报错如下: Failed to load resource: the server responded with ...

  2. spring boot 2.0 thymeleaf调试时正常,打包后运行报错. 找不到模板文件.

    使用th:fragment  定义模板 使用 th:replace  来添加模板到需要的地方. 使用时发现一个非常奇怪的问题. 本机idea 调试环境一切正常, 但是打成jar包以后报错,提示找不到对 ...

  3. Python首次安装后运行报错(0xc000007b)的解决方法

    最近在安装完Python后运行发现居然报错了,错误代码是0xc000007b,于是通过往上查找发现是因为首次安装Python缺乏VC++库的原因,下面通过这篇文章看看如何解决这个问题吧.   错误提示 ...

  4. Heka 编译安装后 运行报错 panic: runtime error: cgo argument has Go pointer to Go pointer

    Heka 编译安装后 运行报错 panic: runtime error: cgo argument has Go pointer to Go pointer 解决办法: 1.  Start heka ...

  5. vue 使用webpack打包后路径报错以及 alias 的使用

    一.vue 使用webpack打包后路径报错(两步解决) 1. config文件夹 ==> index.js ==> 把assetsPublicPath的 '/ '改为 './' 2. b ...

  6. IDEA导出jar包后运行报错 找不到或无法加载主类

    开发工具:IDEA16 运行环境:ubuntu 问题:根据网上的Idea导出jar包的方法,将我的项目导出jar包后运行报错:找不到或无法加载主类.   为了找到这个原因,我重新搭建了一个测试例子,在 ...

  7. 【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter

    Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS 使用 Pyinstaller 打包时候报错 3027 ERROR: Tc ...

  8. textarea元素在加上runat="server"后运行报错解决

    当出现这个报错的时候,在后台引用相应的命名空间,为 using System.Web.UI; using System.Web.UI.HtmlControls;using System.Web.UI. ...

  9. moviepy应用pyinstaller打包后执行报错AttributeError: module audio/video.fx.all has no attribute fadein、crop

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 在开发moviepy的Python程序使用pyinstaller打包后 ...

随机推荐

  1. [翻译]opengl扩展教程1

    [翻译]opengl扩展教程1 原文地址https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/extensions.php [翻译]ope ...

  2. 【GoLang】类型和作用在它上面定义的方法必须在同一个包里定义

    cannot define new methods on non-local type int 参考资料: http://wiki.jikexueyuan.com/project/the-way-to ...

  3. springboot 整合Redis

    0.导入 maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifact ...

  4. 《Head First Servlet JSP》web服务器,容器,servlet的职责

    (一)web服务器,容器,servlet的职责 (二)J2EE服务器与web容器

  5. Java GUI学习笔记之初识AWT和Swing

    Frame f = new Frame(); //获取显示器的尺寸 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize() ...

  6. ios 中使用https的知识

    先看文章,这篇文章说的是使用AFNetworing进行https时的事项,十分好!http://blog.cnbang.net/tech/2416/ ios中使用https,主要就是使用NSURLCr ...

  7. HTML DOM scale() 方法

    语法 scale(sx, sy) 参数 参数 描述 sx, sy 水平和垂直的缩放因子. 描述 scale() 方法为画布的当前变换矩阵添加一个缩放变换.缩放通过独立的水平和垂直缩放因子来完成.例如, ...

  8. WP8 双击返回键退出

    bool isExit = false; // 构造函数 public MainPage() { InitializeComponent(); isExit = false; // 用于本地化 App ...

  9. 仿美团外卖,饿了吗 两个ListView联动,左边点击切换右边,右边滑动切换左边

    先上效果图: 实现思路: 1.先说右边标题: 首先,右边的数据源集合中的Javabean中含有三个属性name,type,title,而每个条目中会默认含有一个标题. 如果这是第一个条目,就让标题显示 ...

  10. css 自动换行 [英文、数字、中文]

    white-space:normal;overflow: auto;table-layout:fixed; word-break: break-all;