|
2026-10-22
| ||
| 17:19 | • Ticket [fd1e6bbe81] TkInter crashes on OSX when skimage.io is imported statu... artifact: d5d5a028e1 user: serhiy.storchaka | |
|
2026-09-20
| ||
| 10:52 | • Closed ticket [fd1e6bbe81]. artifact: 7f7ecdb4b2 user: serhiy.storchaka | |
|
2016-01-22
| ||
| 20:23 | • New ticket [fd1e6bbe81]. artifact: beea8922a4 user: anonymous | |
TkInter crashes on OSX when skimage.io is imported
Closed / Duplicatefd1e6bbe8124b2432e455824c509b595853b5cb5Created 11 years agoUpdated 41 days ago
Descriptionhtml2016-01-22 20:23:07
Running python 3.5.1 on OSX 10.10.5.
I have skimage version 0.11.3 installed.
The following consistently crashes
from skimage.io import imread, imsave from tkinter import * root = Tk()The stack trace looks like
2016-01-22 14:54:54.343 Python[59450:2307564] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f80e456abe0
2016-01-22 14:54:54.344 Python[59450:2307564] An uncaught exception was raised
2016-01-22 14:54:54.344 Python[59450:2307564] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f80e456abe0
2016-01-22 14:54:54.344 Python[59450:2307564] (
0 CoreFoundation 0x00007fff887a403c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8836176e objc_exception_throw + 43
2 CoreFoundation 0x00007fff887a70ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff886ece24 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff886ec998 _CF_forwarding_prep_0 + 120
5 Tk 0x0000000112d91527 TkpInit + 476
6 Tk 0x0000000112d0baca Tk_Init + 1788
7 _tkinter.cpython-35m-darwin.so 0x0000000112be8d6a Tcl_AppInit + 82
8 _tkinter.cpython-35m-darwin.so 0x0000000112be431e _tkinter_create + 1112
9 Python 0x000000010bb11415 PyCFunction_Call + 273
10 Python 0x000000010bb74e17 PyEval_EvalFrameEx + 22399
11 Python 0x000000010bb782a4 _PyEval_EvalCodeWithName + 1884
12 Python 0x000000010bb6f683 PyEval_EvalCodeEx + 78
13 Python 0x000000010bafa5f3 function_call + 377
14 Python 0x000000010bad8970 PyObject_Call + 97
15 Python 0x000000010baeb12c method_call + 140
16 Python 0x000000010bad8970 PyObject_Call + 97
17 Python 0x000000010bb2345d slot_tp_init + 57
18 Python 0x000000010bb207e2 type_call + 171
19 Python 0x000000010bad8970 PyObject_Call + 97
20 Python 0x000000010bb74b73 PyEval_EvalFrameEx + 21723
21 Python 0x000000010bb782a4 _PyEval_EvalCodeWithName + 1884
22 Python 0x000000010bb6f62f PyEval_EvalCode + 81
23 Python 0x000000010bb951b5 run_mod + 58
24 Python 0x000000010bb95496 PyRun_FileExFlags + 178
25 Python 0x000000010bb94aea PyRun_SimpleFileExFlags + 469
26 Python 0x000000010bba8afe Py_Main + 3342
27 Python 0x000000010bacbe27 Python + 7719
28 libdyld.dylib 0x00007fff8f4305c9 start + 1
29 ??? 0x0000000000000002 0x0 + 2
)
2016-01-22 14:54:54.345 Python[59450:2307564] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f80e456abe0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff887a403c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8836176e objc_exception_throw + 43
2 CoreFoundation 0x00007fff887a70ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff886ece24 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff886ec998 _CF_forwarding_prep_0 + 120
5 Tk 0x0000000112d91527 TkpInit + 476
6 Tk 0x0000000112d0baca Tk_Init + 1788
7 _tkinter.cpython-35m-darwin.so 0x0000000112be8d6a Tcl_AppInit + 82
8 _tkinter.cpython-35m-darwin.so 0x0000000112be431e _tkinter_create + 1112
9 Python 0x000000010bb11415 PyCFunction_Call + 273
10 Python 0x000000010bb74e17 PyEval_EvalFrameEx + 22399
11 Python 0x000000010bb782a4 _PyEval_EvalCodeWithName + 1884
12 Python 0x000000010bb6f683 PyEval_EvalCodeEx + 78
13 Python 0x000000010bafa5f3 function_call + 377
14 Python 0x000000010bad8970 PyObject_Call + 97
15 Python 0x000000010baeb12c method_call + 140
16 Python 0x000000010bad8970 PyObject_Call + 97
17 Python 0x000000010bb2345d slot_tp_init + 57
18 Python 0x000000010bb207e2 type_call + 171
19 Python 0x000000010bad8970 PyObject_Call + 97
20 Python 0x000000010bb74b73 PyEval_EvalFrameEx + 21723
21 Python 0x000000010bb782a4 _PyEval_EvalCodeWithName + 1884
22 Python 0x000000010bb6f62f PyEval_EvalCode + 81
23 Python 0x000000010bb951b5 run_mod + 58
24 Python 0x000000010bb95496 PyRun_FileExFlags + 178
25 Python 0x000000010bb94aea PyRun_SimpleFileExFlags + 469
26 Python 0x000000010bba8afe Py_Main + 3342
27 Python 0x000000010bacbe27 Python + 7719
28 libdyld.dylib 0x00007fff8f4305c9 start + 1
29 ??? 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1] 59450 abort python3 interface.py
serhiy.storchakawiki2026-09-20 10:52:20
This is a Tk issue on macOS, not Tcl. TkpInit() creates the shared NSApplication object as an instance of Tk's own subclass TKApplication and then calls its _setup: method. When another library has already created the NSApplication object (here something imported by skimage.io, probably matplotlib's macosx backend), NSApp is a plain NSApplication and the call aborts with this exception. Current Tk still works this way.
Tracked in the Tk repository as 3033786 and 637e74c1e7 (which discusses alternatives to subclassing NSApplication).
serhiy.storchaka Ticket [fd1e6bbe81]: 3 changes
[History diff]2026-10-22 17:19:24
Log in (anonymous is fine) to add a comment.