PyInstaller打包的wxPython简单HelloWorld应用程序在m上崩溃

2024-04-25 13:18:25 发布

您现在位置:Python中文网/ 问答频道 /正文

在macOS上运行(窗口化)wxPython Hello World失败。

  • PyInstaller:3.2和3.3.dev0+8892e11
  • Python:2.7.12
  • wxPython:3.0.2.0
  • osx可可操作系统:macOS Sierra 10.12.2

hello world示例:

#!/usr/bin/env python
import wx

app = wx.App(False)  # Create a new app, don't redirect stdout/stderr to a window.
frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window.
frame.Show(True)     # Show the frame.
app.MainLoop()

使用以下命令使用PyInstaller 3.2打包:

^{pr2}$

终端错误输出显示:

...
...
./src/common/stdpbase.cpp(62): assert "traits" failed in Get(): create wxApp before calling this
Segmentation fault: 11

有什么解决办法吗?在


Tags: apphelloworldshowwxpythonmacoswindowdev0