Python和PyGame错误代码134:无法找出原因

2024-09-25 06:27:12 发布

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

每次我在Windows上运行我的代码,它都能工作。我已经在Mac上安装了pygame,但同一个程序不起作用。其他的程序用pygame在Mac上运行,只是不是我的。以下是我得到的错误:

2015-01-17 15:09:41.591 Python[1237:51113] -[SDLApplication _setup:]: un

recognized selector sent to instance 0x105d271e0
2015-01-17 15:09:41.607 Python[1237:51113] An uncaught exception was raised
2015-01-17 15:09:41.607 Python[1237:51113] -[SDLApplication _setup:]: unrecognized selector sent to instance 0x105d271e0
2015-01-17 15:09:41.608 Python[1237:51113] (
    0   CoreFoundation                      0x00007fff8aa1f64c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff936ef6de objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8aa226bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff8a969a84 ___forwarding___ + 1028
    4   CoreFoundation                      0x00007fff8a9695f8 _CF_forwarding_prep_0 + 120
    5   Tk                                  0x00000001024a0527 TkpInit + 476
    6   Tk                                  0x000000010241aaca Tk_Init + 1788
    7   _tkinter.so                         0x00000001007e2f2d Tcl_AppInit + 77
    8   _tkinter.so                         0x00000001007e0477 Tkinter_Create + 919
    9   Python                              0x00000001000e542b PyEval_EvalFrameEx + 31291
    10  Python                              0x00000001000e665d PyEval_EvalCodeEx + 2349
    11  Python                              0x000000010003f76a function_call + 186
    12  Python                              0x000000010000da08 PyObject_Call + 104
    13  Python                              0x000000010002941c method_call + 140
    14  Python                              0x000000010000da08 PyObject_Call + 104
    15  Python                              0x0000000100078651 slot_tp_init + 81
    16  Python                              0x00000001000736c4 type_call + 212
    17  Python                              0x000000010000da08 PyObject_Call + 104
    18  Python                              0x00000001000e1c3f PyEval_EvalFrameEx + 16975
    19  Python                              0x00000001000e665d PyEval_EvalCodeEx + 2349
    20  Python                              0x00000001000e671f PyEval_EvalCode + 63
    21  Python                              0x0000000100110b2e PyRun_FileExFlags + 206
    22  Python                              0x0000000100110edd PyRun_SimpleFileExFlags + 717
    23  Python                              0x000000010012856e Py_Main + 3262
    24  Python                              0x0000000100000e32 Python + 3634
    25  Python                              0x0000000100000c84 Python + 3204
    26  ???                                 0x0000000000000002 0x0 + 2
)
2015-01-17 15:09:41.608 Python[1237:51113] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SDLApplication _setup:]: unrecognized selector sent to instance 0x105d271e0'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8aa1f64c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff936ef6de objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8aa226bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff8a969a84 ___forwarding___ + 1028
    4   CoreFoundation                      0x00007fff8a9695f8 _CF_forwarding_prep_0 + 120
    5   Tk                                  0x00000001024a0527 TkpInit + 476
    6   Tk                                  0x000000010241aaca Tk_Init + 1788
    7   _tkinter.so                         0x00000001007e2f2d Tcl_AppInit + 77
    8   _tkinter.so                         0x00000001007e0477 Tkinter_Create + 919
    9   Python                              0x00000001000e542b PyEval_EvalFrameEx + 31291
    10  Python                              0x00000001000e665d PyEval_EvalCodeEx + 2349
    11  Python                              0x000000010003f76a function_call + 186
    12  Python                              0x000000010000da08 PyObject_Call + 104
    13  Python                              0x000000010002941c method_call + 140
    14  Python                              0x000000010000da08 PyObject_Call + 104
    15  Python                              0x0000000100078651 slot_tp_init + 81
    16  Python                              0x00000001000736c4 type_call + 212
    17  Python                              0x000000010000da08 PyObject_Call + 104
    18  Python                              0x00000001000e1c3f PyEval_EvalFrameEx + 16975
    19  Python                              0x00000001000e665d PyEval_EvalCodeEx + 2349
    20  Python                              0x00000001000e671f PyEval_EvalCode + 63
    21  Python                              0x0000000100110b2e PyRun_FileExFlags + 206
    22  Python                              0x0000000100110edd PyRun_SimpleFileExFlags + 717
    23  Python                              0x000000010012856e Py_Main + 3262
    24  Python                              0x0000000100000e32 Python + 3634
    25  Python                              0x0000000100000c84 Python + 3204
    26  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Process finished with exit code 134

你能告诉我怎么了吗。可能是什么错误。顺便说一句:我没有上传我的代码,因为它很长,有不同的自定义模块。希望有人能通过查看错误来帮助你。在


Tags: tosotkinterexceptionpyruncalltkpyobject