Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Mac Os上使用Tkinter Gui时发生启动错误_Python_User Interface_Tkinter - Fatal编程技术网

Python 在Mac Os上使用Tkinter Gui时发生启动错误

Python 在Mac Os上使用Tkinter Gui时发生启动错误,python,user-interface,tkinter,Python,User Interface,Tkinter,我在Mac上运行Tkinter GUI时遇到以下错误 我正在尝试创建一个交易机器人,并使用Tkinter GUI将其可视化,并给出一些命令: 如何解决? matplotlib.use('TkAgg') 2021-04-13 00:48:27.816 Python[6471:70564] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fb9756bef10 2021-04-13 00:48:27.817

我在Mac上运行Tkinter GUI时遇到以下错误 我正在尝试创建一个交易机器人,并使用Tkinter GUI将其可视化,并给出一些命令: 如何解决?

  matplotlib.use('TkAgg')
2021-04-13 00:48:27.816 Python[6471:70564] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fb9756bef10
2021-04-13 00:48:27.817 Python[6471:70564] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fb9756bef10'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff2049e6af __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff201d63c9 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff20520c85 -[NSObject(NSObject) __retain_OA] + 0
    3   CoreFoundation                      0x00007fff2040607d ___forwarding___ + 1467
    4   CoreFoundation                      0x00007fff20405a38 _CF_forwarding_prep_0 + 120
    5   Tk                                  0x00007fff6ff85bae TkpInit + 826
    6   Tk                                  0x00007fff6ff056a8 Tk_Init + 1698
    7   _tkinter.so                         0x000000010e8dabc4 Tcl_AppInit + 84
    8   _tkinter.so                         0x000000010e8da59a init_tkinter + 20598
    9   Python                              0x000000010e5e978b PyEval_EvalFrameEx + 19816
    10  Python                              0x000000010e5e4410 PyEval_EvalCodeEx + 536
    11  Python                              0x000000010e58b29c PyFunction_SetClosure + 772
    12  Python                              0x000000010e56d861 PyObject_Call + 97
    13  Python                              0x000000010e5780e1 PyMethod_New + 1169
    14  Python                              0x000000010e56d861 PyObject_Call + 97
    15  Python                              0x000000010e5ee26f PyEval_CallObjectWithKeywords + 159
    16  Python                              0x000000010e57641a PyInstance_New + 123
    17  Python                              0x000000010e56d861 PyObject_Call + 97
    18  Python                              0x000000010e5e9775 PyEval_EvalFrameEx + 19794
    19  Python                              0x000000010e5ee923 _PyEval_SliceIndexNotNone + 384
    20  Python                              0x000000010e5e96d5 PyEval_EvalFrameEx + 19634
    21  Python                              0x000000010e5e4410 PyEval_EvalCodeEx + 536
    22  Python                              0x000000010e5e41f2 PyEval_EvalCode + 32
    23  Python                              0x000000010e606ca9 PyParser_ASTFromFile + 279
    24  Python                              0x000000010e606d50 PyRun_FileExFlags + 130
    25  Python                              0x000000010e6068d7 PyRun_SimpleFileExFlags + 703
    26  Python                              0x000000010e61845b Py_Main + 3203
    27  libdyld.dylib                       0x00007fff20347621 start + 1
    28  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

您能否提供导致问题的代码(请确保它是最低限度的)?你在tkinter中使用线程了吗?@TheLizzard请看这里:代码太多了。尝试删除不必要的部分以使调试更容易。@Lizzard已经做了必要的更改以使调试更容易您知道您可以将所有这些
。配置(…)
s为1?因此,您不必编写
.configure(…)
.configure(…)
而只需使用
.configure(…,…)