使用matplotlib(tk后端)时出现一个奇怪的错误。我知道api在最新的稳定版本中已更改,因此我必须更改代码。使用旧版本时没问题。我该如何解决?
2018-11-20 20:29:57.126 Python[60013:847240] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8695fc4a30
2018-11-20 20:29:57.129 Python[60013:847240] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8695fc4a30'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff3eb09fcb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff657c3c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff3eba2a24 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff3ea80610 ___forwarding___ + 1456
4 CoreFoundation 0x00007fff3ea7ffd8 _CF_forwarding_prep_0 + 120
5 libtk8.6.dylib 0x000000011ec631f2 TkpInit + 408
6 libtk8.6.dylib 0x000000011ebd2aac Initialize + 2454
7 _tkinter.cpython-36m-darwin.so 0x000000011b1f3dd4 Tcl_AppInit + 84
8 _tkinter.cpython-36m-darwin.so 0x000000011b1f3aab _tkinter_create + 1115
9 Python 0x000000010d2e0e1b _PyCFunction_FastCallDict + 491
10 Python 0x000000010d363a87 call_function + 439
11 Python 0x000000010d3601f7 _PyEval_EvalFrameDefault + 27559
12 Python 0x000000010d3644ef _PyEval_EvalCodeWithName + 2447
13 Python 0x000000010d3650bb _PyFunction_FastCallDict + 763
14 Python 0x000000010d297e57 _PyObject_FastCallDict + 247
15 Python 0x000000010d297f75 _PyObject_Call_Prepend + 149
16 Python 0x000000010d297c90 PyObject_Call + 96
17 Python 0x000000010d2f904d slot_tp_init + 125
18 Python 0x000000010d2f5279 type_call + 313
19 Python 0x000000010d297e25 _PyObject_FastCallDict + 197
20 Python 0x000000010d363988 call_function + 184
21 Python 0x000000010d3601f7 _PyEval_EvalFrameDefault + 27559
22 Python 0x000000010d3644ef _PyEval_EvalCodeWithName + 2447
23 Python 0x000000010d364da1 fast_function + 545
24 Python 0x000000010d363a61 call_function + 401
25 Python 0x000000010d360296 _PyEval_EvalFrameDefault + 27718
26 Python 0x000000010d3644ef _PyEval_EvalCodeWithName + 2447
27 Python 0x000000010d359584 PyEval_EvalCode + 100
28 Python 0x000000010d38f5f1 PyRun_FileExFlags + 209
29 Python 0x000000010d38ee62 PyRun_SimpleFileExFlags + 882
30 Python 0x000000010d3a8db2 Py_Main + 3554
31 Python 0x000000010d283df8 Python + 3576
32 libdyld.dylib 0x00007fff663b3115 start + 1
33 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException