1

im trying to run a tkinter based program with pygame imported and used as well, and whenever I try to run this program on my mac computer I get this error:

2021-03-07 18:25:28.465 Python[6025:134545] -[SDLApplication _setup:]: unrecognized selector sent to instance 0x7ffced456520
2021-03-07 18:25:28.468 Python[6025:134545] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SDLApplication _setup:]: unrecognized selector sent to instance 0x7ffced456520'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff206226af __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff2035a3c9 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff206a4c85 -[NSObject(NSObject) __retain_OA] + 0
    3   CoreFoundation                      0x00007fff2058a07d ___forwarding___ + 1467
    4   CoreFoundation                      0x00007fff20589a38 _CF_forwarding_prep_0 + 120
    5   libtk8.6.dylib                      0x0000000105ffb1f2 TkpInit + 408
    6   libtk8.6.dylib                      0x0000000105f6aaac Initialize + 2454
    7   _tkinter.cpython-39-darwin.so       0x0000000105dbe6d4 Tcl_AppInit + 84
    8   _tkinter.cpython-39-darwin.so       0x0000000105dbdff2 _tkinter_create + 1362
    9   Python                              0x0000000105a403ea cfunction_vectorcall_FASTCALL + 218
    10  Python                              0x0000000105ad85cc call_function + 732
    11  Python                              0x0000000105ad5af3 _PyEval_EvalFrameDefault + 25219
    12  Python                              0x0000000105ad92c3 _PyEval_EvalCode + 2611
    13  Python                              0x0000000105a02401 _PyFunction_Vectorcall + 289
    14  Python                              0x0000000105a01b05 _PyObject_FastCallDictTstate + 293
    15  Python                              0x0000000105a026e8 _PyObject_Call_Prepend + 152
    16  Python                              0x0000000105a5be85 slot_tp_init + 165
    17  Python                              0x0000000105a573d9 type_call + 345
    18  Python                              0x0000000105a01cad _PyObject_MakeTpCall + 365
    19  Python                              0x0000000105ad865c call_function + 876
    20  Python                              0x0000000105ad5af3 _PyEval_EvalFrameDefault + 25219
    21  Python                              0x0000000105a02478 function_code_fastcall + 104
    22  Python                              0x0000000105a01b05 _PyObject_FastCallDictTstate + 293
    23  Python                              0x0000000105a026e8 _PyObject_Call_Prepend + 152
    24  Python                              0x0000000105a5be85 slot_tp_init + 165
    25  Python                              0x0000000105a573d9 type_call + 345
    26  Python                              0x0000000105a01cad _PyObject_MakeTpCall + 365
    27  Python                              0x0000000105ad865c call_function + 876
    28  Python                              0x0000000105ad5b8b _PyEval_EvalFrameDefault + 25371
    29  Python                              0x0000000105ad92c3 _PyEval_EvalCode + 2611
    30  Python                              0x0000000105acf74b PyEval_EvalCode + 139
    31  Python                              0x0000000105b23273 pyrun_file + 387
    32  Python                              0x0000000105b21632 PyRun_SimpleFileExFlags + 850
    33  Python                              0x0000000105b3e659 Py_RunMain + 1801
    34  Python                              0x0000000105b3eaef pymain_main + 223
    35  Python                              0x0000000105b3eceb Py_BytesMain + 43
    36  libdyld.dylib                       0x00007fff204cb621 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Note that the exact same program runs totally fine on my 2 windows PC's without any problems, and the fact that when I run the same program without the pygame lines works as well on both my mac and windows computers.

I've tried to uninstall and install the pygame module but that seems to have no effect. I'm running it on PyCharm version 203.7148.72 (last update) Can anyone help me figure out why?

Thanks in advance!

Thalis
  • 188
  • 2
  • 12
  • What version of Python and Tk are you using? (for Tk version, what is the output of `tkinter.test.support.get_tk_patchlevel()`?) Also, where are you creating your `Tk()` instance? – Minion Jim Mar 07 '21 at 17:48
  • I'm using python 3.9.2 for Mac OS X and the window that pops up with the command you mentioned says im using version 8.6 of Tcl/Tk. I've created my `Tk()` instance inside my class' `def __init__(self):` function as so: `self.root = tk.Tk()`. I should also mention that in order for me to get the tk version that im using i had to modify the command from `tkinter.test.support.get_tk_patchlevel()` to `tkinter._test.support.get_tk_patchlevel()` – Thalis Mar 07 '21 at 18:17
  • Sorry, I was meaning the entire Tk patchlevel (e.g. 8.6.8 / 8.6.11). What I would recommend is if you used the Intel installer to install Python, try the Universal2 installer instead and if you used the Universal2 installer, to file a bug on bugs.python.org so they can assess it (along with a minimal example). – Minion Jim Mar 08 '21 at 09:06

0 Answers0