'NSInternalInconsistencyException',原因:'nextEventMatchingMask只能从主线程中调用!'

时间:2018-03-15 09:44:36

标签: python pdb

在我的Django应用程序中,如果我在代码中的任何位置使用调试器(pdb),则会抛出此错误并突然关闭应用程序。

任何线索都会非常感激。

-> roc_score = metrics.roc_auc_score(y_a, y_p)
    (Pdb) 2018-03-15 09:31:46.205 Python[71934:1568993] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x00007fff90e9757b __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x00007fffa60fa1da objc_exception_throw + 48
        2   AppKit                              0x00007fff8f082e82 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4480
        3   _macosx.cpython-36m-darwin.so       0x000000010c9f9baf wait_for_stdin + 479
        4   readline.cpython-36m-darwin.so      0x0000000104cfc2d2 call_readline + 359
        5   Python                              0x000000010487daef PyOS_Readline + 180
        6   Python                              0x0000000104915e70 builtin_input + 1232
        7   Python                              0x00000001048bba99 _PyCFunction_FastCallDict + 166
        8   Python                              0x000000010492012a call_function + 489
        9   Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        10  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        11  Python                              0x0000000104920f8f fast_function + 218
        12  Python                              0x0000000104920101 call_function + 448
        13  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        14  Python                              0x000000010492122f _PyFunction_FastCall + 121
        15  Python                              0x0000000104920101 call_function + 448
        16  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        17  Python                              0x000000010492122f _PyFunction_FastCall + 121
        18  Python                              0x0000000104920101 call_function + 448
        19  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        20  Python                              0x000000010492122f _PyFunction_FastCall + 121
        21  Python                              0x0000000104920101 call_function + 448
        22  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        23  Python                              0x000000010492122f _PyFunction_FastCall + 121
        24  Python                              0x0000000104920101 call_function + 448
        25  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        26  Python                              0x000000010492122f _PyFunction_FastCall + 121
        27  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        28  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        29  Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        30  Python                              0x0000000104947b24 call_trampoline + 108
        31  Python                              0x0000000104947b8a trace_trampoline + 34
        32  Python                              0x000000010491e01e _PyEval_EvalFrameDefault + 25330
        33  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        34  Python                              0x0000000104920f8f fast_function + 218
        35  Python                              0x0000000104920101 call_function + 448
        36  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        37  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        38  Python                              0x0000000104917cf1 PyEval_EvalCodeEx + 57
        39  Python                              0x00000001048a4056 function_call + 339
        40  Python                              0x0000000104883d42 PyObject_Call + 101
        41  Python                              0x0000000104919260 _PyEval_EvalFrameDefault + 5428
        42  Python                              0x000000010492122f _PyFunction_FastCall + 121
        43  Python                              0x0000000104920101 call_function + 448
        44  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        45  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        46  Python                              0x0000000104920f8f fast_function + 218
        47  Python                              0x0000000104920101 call_function + 448
        48  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        49  Python                              0x000000010492122f _PyFunction_FastCall + 121
        50  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        51  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        52  Python                              0x0000000104883d42 PyObject_Call + 101
        53  Python                              0x00000001048ce34c slot_tp_call + 50
        54  Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        55  Python                              0x00000001049200fa call_function + 441
        56  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        57  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        58  Python                              0x0000000104920f8f fast_function + 218
        59  Python                              0x0000000104920101 call_function + 448
        60  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        61  Python                              0x000000010492122f _PyFunction_FastCall + 121
        62  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        63  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        64  Python                              0x0000000104883d42 PyObject_Call + 101
        65  Python                              0x00000001048ce34c slot_tp_call + 50
        66  Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        67  Python                              0x00000001049200fa call_function + 441
        68  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        69  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        70  Python                              0x0000000104920f8f fast_function + 218
        71  Python                              0x0000000104920101 call_function + 448
        72  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        73  Python                              0x000000010492122f _PyFunction_FastCall + 121
        74  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        75  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        76  Python                              0x0000000104883d42 PyObject_Call + 101
        77  Python                              0x00000001048ce34c slot_tp_call + 50
        78  Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        79  Python                              0x00000001049200fa call_function + 441
        80  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        81  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        82  Python                              0x0000000104920f8f fast_function + 218
        83  Python                              0x0000000104920101 call_function + 448
        84  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        85  Python                              0x000000010492122f _PyFunction_FastCall + 121
        86  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        87  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        88  Python                              0x0000000104883d42 PyObject_Call + 101
        89  Python                              0x00000001048ce34c slot_tp_call + 50
        90  Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        91  Python                              0x00000001049200fa call_function + 441
        92  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        93  Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        94  Python                              0x0000000104920f8f fast_function + 218
        95  Python                              0x0000000104920101 call_function + 448
        96  Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        97  Python                              0x000000010492122f _PyFunction_FastCall + 121
        98  Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        99  Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        100 Python                              0x0000000104883d42 PyObject_Call + 101
        101 Python                              0x00000001048ce34c slot_tp_call + 50
        102 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        103 Python                              0x00000001049200fa call_function + 441
        104 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        105 Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        106 Python                              0x0000000104920f8f fast_function + 218
        107 Python                              0x0000000104920101 call_function + 448
        108 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        109 Python                              0x000000010492122f _PyFunction_FastCall + 121
        110 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        111 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        112 Python                              0x0000000104883d42 PyObject_Call + 101
        113 Python                              0x00000001048ce34c slot_tp_call + 50
        114 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        115 Python                              0x00000001049200fa call_function + 441
        116 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        117 Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        118 Python                              0x0000000104920f8f fast_function + 218
        119 Python                              0x0000000104920101 call_function + 448
        120 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        121 Python                              0x000000010492122f _PyFunction_FastCall + 121
        122 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        123 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        124 Python                              0x0000000104883d42 PyObject_Call + 101
        125 Python                              0x00000001048ce34c slot_tp_call + 50
        126 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        127 Python                              0x00000001049200fa call_function + 441
        128 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        129 Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        130 Python                              0x0000000104920f8f fast_function + 218
        131 Python                              0x0000000104920101 call_function + 448
        132 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        133 Python                              0x000000010492122f _PyFunction_FastCall + 121
        134 Python                              0x0000000104920101 call_function + 448
        135 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        136 Python                              0x000000010492122f _PyFunction_FastCall + 121
        137 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        138 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        139 Python                              0x0000000104883d42 PyObject_Call + 101
        140 Python                              0x00000001048ce34c slot_tp_call + 50
        141 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        142 Python                              0x00000001049200fa call_function + 441
        143 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        144 Python                              0x000000010492088c _PyEval_EvalCodeWithName + 1719
        145 Python                              0x000000010492115f _PyFunction_FastCallDict + 449
        146 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        147 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        148 Python                              0x0000000104883d42 PyObject_Call + 101
        149 Python                              0x00000001048ce34c slot_tp_call + 50
        150 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        151 Python                              0x00000001049200fa call_function + 441
        152 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        153 Python                              0x000000010492122f _PyFunction_FastCall + 121
        154 Python                              0x0000000104920101 call_function + 448
        155 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        156 Python                              0x000000010492122f _PyFunction_FastCall + 121
        157 Python                              0x0000000104920101 call_function + 448
        158 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        159 Python                              0x000000010492122f _PyFunction_FastCall + 121
        160 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        161 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        162 Python                              0x0000000104883d42 PyObject_Call + 101
        163 Python                              0x00000001048cec76 slot_tp_init + 57
        164 Python                              0x00000001048cbc04 type_call + 184
        165 Python                              0x0000000104883e8c _PyObject_FastCallDict + 143
        166 Python                              0x00000001049200fa call_function + 441
        167 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        168 Python                              0x000000010492122f _PyFunction_FastCall + 121
        169 Python                              0x0000000104920101 call_function + 448
        170 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        171 Python                              0x000000010492122f _PyFunction_FastCall + 121
        172 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        173 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        174 Python                              0x0000000104883d42 PyObject_Call + 101
        175 Python                              0x0000000104919260 _PyEval_EvalFrameDefault + 5428
        176 Python                              0x000000010492122f _PyFunction_FastCall + 121
        177 Python                              0x0000000104920101 call_function + 448
        178 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        179 Python                              0x000000010492122f _PyFunction_FastCall + 121
        180 Python                              0x0000000104920101 call_function + 448
        181 Python                              0x0000000104918ff7 _PyEval_EvalFrameDefault + 4811
        182 Python                              0x000000010492122f _PyFunction_FastCall + 121
        183 Python                              0x0000000104883ec1 _PyObject_FastCallDict + 196
        184 Python                              0x0000000104883fe4 _PyObject_Call_Prepend + 156
        185 Python                              0x0000000104883d42 PyObject_Call + 101
        186 Python                              0x000000010495581b t_bootstrap + 70
        187 libsystem_pthread.dylib             0x00007fffa6bf493b _pthread_body + 180
        188 libsystem_pthread.dylib             0x00007fffa6bf4887 _pthread_body + 0
        189 libsystem_pthread.dylib             0x00007fffa6bf408d thread_start + 13
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    Abort trap: 6

0 个答案:

没有答案