在 Parallels Desktop 上运行通过 py2exe 生成的 .exe
我在 Windows XP 上使用 py2exe 生成了一个 .exe 文件。分发后,该可执行文件可以在 Windows XP 和 Windows 7 上顺利运行。
但是,当在通过 Mac 并行桌面模拟的 Windows XP 上启动时,会出现错误,指出“应用程序无法启动,因为配置不正确”。并建议我重新安装它。如果在启用控制台的情况下构建,系统不会生成错误消息,并且控制台窗口会短暂闪烁然后消失。应用程序不启动。
分发后,我从还包含 msvcp90.dll 的目录启动 .exe。我相信其他所有内容都捆绑到 .exe 中。我在下面包含了我的 setup.py 文件以供参考。
有没有人设法在 Windows 系统上通过 py2exe 生成 .exe 以随后在并行桌面中运行?
设置.py:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "frontend.py"}],
zipfile = None
)
I've generated an .exe file using py2exe on Windows XP. This executable runs smoothly on Windows XP and Windows 7 when distributed.
When launched on Windows XP emulated via Mac's Parallel Desktop, however, an error occurs stating that "the application failed to launch because the configuration is incorrect." and suggesting that I re-install it. If built with console enabled, no error message is generated by the system, and the console window flashes briefly before disappearing. The application does not launch.
When distributed, I launch the .exe from a directory also containing msvcp90.dll. I believe everything else is bundled into the .exe. I've included my setup.py file below for reference.
Has anyone managed to get an .exe generated via py2exe on a Windows system to subsequently run in Parallel Desktop?
setup.py:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "frontend.py"}],
zipfile = None
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是由于并行桌面 XP 上未安装 Microsoft Visual C++ 运行时 DLL。我认为您可能需要安装 Microsoft Visual C++ 2008 SP1 Redistributables;您可以从这里获取它们: http://www.microsoft.com/下载/en/details.aspx?id=5582。
请注意,您可能需要安装非 SP1 可再发行版或 VC8/Visual C++ 2005 版 - 我不确定到底需要什么,而且它也可能取决于 Python 版本。
一般来说,这不是并行桌面的问题,它只是需要满足的依赖关系,如果您使用安装程序,您将自动安装可再发行组件。一旦您在计算机上安装了它们,它就应该可以正常工作。
It's likely that this is due to the Microsoft Visual C++ Runtime DLLs not being installed on the Parallel Desktop XP. I think you probably need the Microsoft Visual C++ 2008 SP1 Redistributables installed; you can get them from here: http://www.microsoft.com/download/en/details.aspx?id=5582.
Note that you might need the non-SP1 redistributables or the VC8/Visual C++ 2005 ones installed instead - I'm not sure exactly what is needed, and it may depend on Python version as well.
Generally this isn't a problem with Parallel Desktop, it's just a dependency which needs to be met and if you were using an installer, you would install the redistributables automatically. Once you have installed them once on the computer, it should just work.