在OSX 10.10.5上重现简单易行
from skimage.io import imread, imsave
from tkinter import *
root = Tk()
导致大堆栈转储
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
答案 0 :(得分:1)
我能够通过使用imread和imsave
的scipy版本来解决这个问题这很好用。
from scipy.misc import imread, imsave
from tkinter import *
root = Tk()