我正在使用cx_freeze生成一个有效的.app文件,最终生成一个有效的msi文件.在使用build命令构建它之后,我一直在测试应用程序正常工作,如“python3 setup.py build”中所示.这一切都很好,没有意外的崩溃.
继续使用“python3 setup.py bdist_dmg”打包它.打开dmg文件/ app文件,它们立即崩溃,发出此错误:
Process: main [1098]Path: /Users/USER/*/FYP-0.1.app/Contents/MacOS/mainIDentifIEr: mainVersion: 0Code Type: X86-64 (Native)Parent Process: ??? [1]Responsible: main [1098]User ID: 501Date/Time: 2015-05-12 02:18:16.867 +0100OS Version: Mac OS X 10.10.3 (14D131)Report Version: 11Anonymous UUID: 8A613A61-D35F-9A4C-8E97-57069A95BF20Time Awake Since Boot: 1300 secondsCrashed Thread: 0 dispatch queue: com.apple.main-threadException Type: EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000VM Regions Near 0:--> __TEXT 0000000103135000-0000000103138000 [ 12K] r- x/rwx SM=COW /Users/USER/*/FYP-0.1.app/Contents/MacOS/mainThread 0 Crashed:: dispatch queue: com.apple.main-thread0 QtGui 0x000000010ecf126b QApplication::setActiveWindow(QWidget*) + 3151 QtGui 0x000000010ec90b7d onapplicationwindowChangedActivation(QWidget*,bool) + 1002 com.apple.CoreFoundation 0x00007fff8e99045c __CFNOTIFICATIONCENTER_IS_CALliNG_OUT_TO_AN_OBSERVER__ + 123 com.apple.CoreFoundation 0x00007fff8e880634 _CFXNotificationPost + 31404 com.apple.Foundation 0x00007fff94cd29d1 -[NSNotificationCenter postNotificationname:object:userInfo:] + 665 com.apple.AppKit 0x00007fff9048dbd9 -[NSWindow becomeKeyWindow] + 14066 com.apple.AppKit 0x00007fff9048cf3e -[NSWindow _changeKeyAndMainlimitedOK:] + 7957 com.apple.AppKit 0x00007fff9048cb36 -[NSWindow _makeKeyRegardlessOfVisibility] + 988 com.apple.AppKit 0x00007fff9048ca9e -[NSWindow makeKeyAndOrderFront:] + 279 QtGui 0x00000001045cfea7 QWidgetPrivate::show_sys() + 62910 QtGui 0x000000010466c39c QWidgetPrivate::show_helper() + 43211 QtGui 0x000000010466ccce QWidget::setVisible(bool) + 80012 PyQt4.QtGui.so 0x0000000103f40634 sipQMainWindow::setVisible(bool) + 10013 PyQt4.QtGui.so 0x00000001040f7ed9 meth_QWidget_show(_object*,_object*) + 10514 Python 0x0000000103315ad5 PyEval_EvalFrameEx + 2212915 Python 0x0000000103318f12 fast_function + 20316 Python 0x0000000103315964 PyEval_EvalFrameEx + 2176017 Python 0x00000001033102ad PyEval_EvalCodeEx + 162218 Python 0x000000010329e7ab function_call + 37219 Python 0x000000010327e576 PyObject_Call + 10320 Python 0x000000010328fca8 method_call + 13621 Python 0x000000010327e576 PyObject_Call + 10322 Python 0x00000001032c45b2 slot_tp_init + 5723 Python 0x00000001032c1b48 type_call + 17224 Python 0x000000010327e576 PyObject_Call + 10325 Python 0x000000010331582a PyEval_EvalFrameEx + 2144626 Python 0x00000001033102ad PyEval_EvalCodeEx + 162227 Python 0x000000010330fc51 PyEval_EvalCode + 6328 Python 0x000000010330d6e3 builtin_exec + 53629 Python 0x0000000103315ad5 PyEval_EvalFrameEx + 2212930 Python 0x00000001033102ad PyEval_EvalCodeEx + 162231 Python 0x000000010330fc51 PyEval_EvalCode + 6332 main 0x0000000103136cc5 main + 195733 libdyld.dylib 0x00007fff986995c9 start + 1Thread 1:: dispatch queue: com.apple.libdispatch-manager0 libsystem_kernel.dylib 0x00007fff91651232 kevent64 + 101 libdispatch.dylib 0x00007fff96fd0a6a _dispatch_mgr_thread + 52Thread 2:0 libsystem_kernel.dylib 0x00007fff9165094a __workq_kernreturn + 101 libsystem_pthread.dylib 0x00007fff92c4e40d start_wqthread + 13Thread 3:0 libsystem_kernel.dylib 0x00007fff9165094a __workq_kernreturn + 101 libsystem_pthread.dylib 0x00007fff92c4e40d start_wqthread + 13Thread 4:0 libsystem_kernel.dylib 0x00007fff9165094a __workq_kernreturn + 101 libsystem_pthread.dylib 0x00007fff92c4e40d start_wqthread + 13Thread 5:0 libsystem_kernel.dylib 0x00007fff9165094a __workq_kernreturn + 101 libsystem_pthread.dylib 0x00007fff92c4e40d start_wqthread + 13Thread 6:0 libsystem_kernel.dylib 0x00007fff9165094a __workq_kernreturn + 101 libsystem_pthread.dylib 0x00007fff92c4e40d start_wqthread + 13Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x00007fbe8322a670 rcx: 0x00007fbe8326d0a0 rdx: 0x0000000000000002 rdi: 0x00007fbe8322a670 rsi: 0x0000000000000001 rbp: 0x00007fff5cac8ea0 rsp: 0x00007fff5cac8df0 r8: 0x0000000000000000 r9: 0x00007fbe830f90a0 r10: 0x0000000000000011 r11: 0x00007fff7bbdc190 r12: 0x00007fbe8322a670 r13: 0x00000000000f42cd r14: 0x00007fbe83296370 r15: 0x000000010f578228 rip: 0x000000010ecf126b rfl: 0x0000000000010202 cr2: 0x0000000000000000Logical cpu: 0Error Code: 0x00000004Trap Number: 14
有更多的负载,但我不确定有多大相关性.这是我的setup.py文件:
from cx_Freeze import setup,Executableimport sysimport osbase = Noneif sys.platform == "win32": base = "win32gui"zips = ["implementation/primarIEs/GUI/designer_files","implementation/primarIEs/GUI/themes","implementation/primarIEs/GUI/images","implementation/primarIEs/scripts"]build_exe_options = {"packages": ["os"],"excludes": ["tkinter"],"include_files":zips}setup( name='FYP',version='0.1',packages=['implementation','implementation.primarIEs','implementation.primarIEs.GUI','implementation.primarIEs.scripts','implementation.primarIEs.GUI.pyqt_plugins','implementation.primarIEs.Drawing','implementation.primarIEs.Drawing.classes','implementation.primarIEs.Drawing.classes.tree_cls','implementation.primarIEs.ExtractMetadata','implementation.primarIEs.ExtractMetadata.classes','implementation.primarIEs.importOnlineDBs','implementation.primarIEs.importOnlineDBs.classes'],description='Muselib',options = {"build_exe": build_exe_options},executables = [Executable("implementation/main.py",base=base)])
不知道问题是什么,我看到其他一些人有类似的问题,但他们似乎是旧版本的Python或旧版本的OS X,修复程序并没有解决我的问题.任何有关如何进行的建议将不胜感激.
解决方法 找到一种更好的调试方法:右键单击app文件,“查看包内容”,MacOS>选择与setup.py中给出的文件同名的可执行文件(对我来说这是主要的).我得到的错误:
QWidget:必须在QPaintDevice之前构造QApplication
我通过初始化我的Application对象,然后初始化我的主窗口对象,然后显示主窗口,然后调用设置窗口的加载方法来修复此问题.我最初在构造函数中做了那个部分,由于某种原因给出了问题.我现在遇到打开/关闭窗口以及关闭时打开其他窗口的问题,但这可能是谷歌搜索的另一个问题或会话的最佳选择.
总结以上是内存溢出为你收集整理的打包的python .app文件崩溃,但打包的python .sh文件工作正常全部内容,希望文章能够帮你解决打包的python .app文件崩溃,但打包的python .sh文件工作正常所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)