libc++abi: terminating due to uncaught exception of type NSException - python on MAC

54 Views Asked by At

I am writing a game with python on a MAC PC and I am getting the following error:

libc++abi: terminating due to uncaught exception of type NSException

The SnakeGame is written so the player can be able to run using pygame or turtle.

The game is working just fine when running it with pygame, but when switching to turtle I get this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SDLApplication macOSVersion]: unrecognized selector sent to instance 0x15be965f0'
*** First throw call stack:
(
        0   CoreFoundation                      0x000000018b930570 __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x000000018b421eb4 objc_exception_throw + 60
        2   CoreFoundation                      0x000000018b9e212c -[NSObject(NSObject) __retain_OA] + 0
        3   CoreFoundation                      0x000000018b89a7d4 ___forwarding___ + 1572
        4   CoreFoundation                      0x000000018b89a0f0 _CF_forwarding_prep_0 + 96
        5   libtk8.6.dylib                      0x000000010f0d9788 GetRGBA + 48
        6   libtk8.6.dylib                      0x000000010f0d9258 SetCGColorComponents + 144
        7   libtk8.6.dylib                      0x000000010f0d95e8 TkpGetColor + 344
        8   libtk8.6.dylib                      0x000000010f03b508 Tk_GetColor + 220
        9   libtk8.6.dylib                      0x000000010f02eb90 Tk_Get3DBorder + 204
        10  libtk8.6.dylib                      0x000000010f02e9a0 Tk_Alloc3DBorderFromObj + 144
        11  libtk8.6.dylib                      0x000000010f03c8b4 DoObjConfig + 832
        12  libtk8.6.dylib                      0x000000010f03c470 Tk_InitOptions + 348
        13  libtk8.6.dylib                      0x000000010f03c36c Tk_InitOptions + 88
        14  libtk8.6.dylib                      0x000000010f063e30 CreateFrame + 1432
        15  libtk8.6.dylib                      0x000000010f064128 TkListCreateFrame + 156
        16  libtk8.6.dylib                      0x000000010f05d0bc Initialize + 1848
        17  _tkinter.cpython-311-darwin.so      0x000000010eeaa34c Tcl_AppInit + 80
        18  _tkinter.cpython-311-darwin.so      0x000000010eea48a4 Tkapp_New + 592
        19  _tkinter.cpython-311-darwin.so      0x000000010eea428c _tkinter_create + 608
        20  libpython3.11.dylib                 0x0000000100f0edcc cfunction_vectorcall_FASTCALL + 260
        21  libpython3.11.dylib                 0x0000000100ec4844 PyObject_Vectorcall + 80
        22  libpython3.11.dylib                 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788
        23  libpython3.11.dylib                 0x0000000100f9c548 _PyEval_Vector + 200
        24  libpython3.11.dylib                 0x0000000100ec41c0 _PyObject_FastCallDictTstate + 272
        25  libpython3.11.dylib                 0x0000000100ec4f10 _PyObject_Call_Prepend + 160
        26  libpython3.11.dylib                 0x0000000100f3175c slot_tp_init + 188
        27  libpython3.11.dylib                 0x0000000100f27258 type_call + 424
        28  libpython3.11.dylib                 0x0000000100ec43a8 _PyObject_MakeTpCall + 344
        29  libpython3.11.dylib                 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788
        30  libpython3.11.dylib                 0x0000000100f9c548 _PyEval_Vector + 200
        31  libpython3.11.dylib                 0x0000000100ec41c0 _PyObject_FastCallDictTstate + 272
        32  libpython3.11.dylib                 0x0000000100ec4f10 _PyObject_Call_Prepend + 160
        33  libpython3.11.dylib                 0x0000000100f3175c slot_tp_init + 188
        34  libpython3.11.dylib                 0x0000000100f27258 type_call + 424
        35  libpython3.11.dylib                 0x0000000100ec43a8 _PyObject_MakeTpCall + 344
        36  libpython3.11.dylib                 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788
        37  libpython3.11.dylib                 0x0000000100f9c548 _PyEval_Vector + 200
        38  libpython3.11.dylib                 0x0000000100f97c1c builtin___build_class__ + 1148
        39  libpython3.11.dylib                 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160
        40  libpython3.11.dylib                 0x0000000100ec4844 PyObject_Vectorcall + 80
        41  libpython3.11.dylib                 0x0000000100fa49e4 _PyEval_EvalFrameDefault + 33788
        42  libpython3.11.dylib                 0x0000000100f9c418 PyEval_EvalCode + 272
        43  libpython3.11.dylib                 0x0000000100f98f50 builtin_exec + 916
        44  libpython3.11.dylib                 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160
        45  libpython3.11.dylib                 0x0000000100fa6504 _PyEval_EvalFrameDefault + 40732
        46  libpython3.11.dylib                 0x0000000100f9c548 _PyEval_Vector + 200
        47  libpython3.11.dylib                 0x0000000100ec5e90 object_vacall + 248
        48  libpython3.11.dylib                 0x0000000100ec5d00 PyObject_CallMethodObjArgs + 92
        49  libpython3.11.dylib                 0x0000000100fd4a14 PyImport_ImportModuleLevelObject + 1308
        50  libpython3.11.dylib                 0x0000000100fa1e14 _PyEval_EvalFrameDefault + 22572
        51  libpython3.11.dylib                 0x0000000100f9c418 PyEval_EvalCode + 272
        52  libpython3.11.dylib                 0x0000000100f98f50 builtin_exec + 916
        53  libpython3.11.dylib                 0x0000000100f0ee8c cfunction_vectorcall_FASTCALL_KEYWORDS + 160
        54  libpython3.11.dylib                 0x0000000100fa6504 _PyEval_EvalFrameDefault + 40732
        55  libpython3.11.dylib                 0x0000000100f9c548 _PyEval_Vector + 200
        56  libpython3.11.dylib                 0x0000000100ec5e90 object_vacall + 248
        57  libpython3.11.dylib                 0x0000000100ec5d00 PyObject_CallMethodObjArgs + 92
        58  libpython3.11.dylib                 0x0000000100fd4a14 PyImport_ImportModuleLevelObject + 1308
        59  libpython3.11.dylib                 0x0000000100fa1e14 _PyEval_EvalFrameDefault + 22572
        60  libpython3.11.dylib                 0x0000000100f9c418 PyEval_EvalCode + 272
        61  libpython3.11.dylib                 0x0000000100fef2c8 run_mod + 152
        62  libpython3.11.dylib                 0x0000000100fed7bc _PyRun_SimpleFileObject + 852
        63  libpython3.11.dylib                 0x0000000100fed244 _PyRun_AnyFileObject + 160
        64  libpython3.11.dylib                 0x000000010100cd0c Py_RunMain + 1848
        65  libpython3.11.dylib                 0x000000010100d0bc pymain_main + 324
        66  libpython3.11.dylib                 0x000000010100d15c Py_BytesMain + 40
        67  dyld                                0x000000018b45d0e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
Abort trap: 6

I looked online a lot and saw similar errors for developers using swift.

0

There are 0 best solutions below