python-导入熊猫导致调试模式终止
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了python-导入熊猫导致调试模式终止,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含9035字,纯文字阅读大概需要13分钟。
内容图文
在我的macbookpro macOS Mojave 10.14.2(18C54)上,我正在使用PyCharm调试我的python代码(Python3.6),在调试模式下出现错误消息,如下所示:
2019-02-11 17:59:46.750 python3.6[1727:27356] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fa9565936d0
2019-02-11 17:59:46.752 python3.6[1727:27356] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fa9565936d0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff2ff3aecd __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff5bff2720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff2ffb8275 -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff2fedcb40 ___forwarding___ + 1486
4 CoreFoundation 0x00007fff2fedc4e8 _CF_forwarding_prep_0 + 120
5 libtk8.6.dylib 0x000000011eb4231d TkpInit + 413
6 libtk8.6.dylib 0x000000011ea9a17e Initialize + 2622
7 _tkinter.cpython-36m-darwin.so 0x000000011e8c2a16 _tkinter_create + 1174
8 python3.6 0x000000010839c068 _PyCFunction_FastCallDict + 200
9 python3.6 0x000000010847161f call_function + 143
10 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
11 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
12 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
13 python3.6 0x00000001084722cc _PyFunction_FastCallDict + 364
14 python3.6 0x000000010831af80 _PyObject_FastCallDict + 320
15 python3.6 0x00000001083425f8 method_call + 136
16 python3.6 0x00000001083225ce PyObject_Call + 62
17 python3.6 0x00000001083c35b5 slot_tp_init + 117
18 python3.6 0x00000001083c7af1 type_call + 241
19 python3.6 0x000000010831aef1 _PyObject_FastCallDict + 177
20 python3.6 0x0000000108471718 call_function + 392
21 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
22 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
23 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
24 python3.6 0x0000000108471a8a fast_function + 362
25 python3.6 0x000000010847167c call_function + 236
26 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
27 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
28 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
29 python3.6 0x0000000108471a8a fast_function + 362
30 python3.6 0x000000010847167c call_function + 236
31 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
32 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
33 python3.6 0x00000001084719dc fast_function + 188
34 python3.6 0x000000010847167c call_function + 236
35 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
36 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
37 python3.6 0x00000001084719dc fast_function + 188
38 python3.6 0x000000010847167c call_function + 236
39 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
40 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
41 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
42 python3.6 0x0000000108471a8a fast_function + 362
43 python3.6 0x000000010847167c call_function + 236
44 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
45 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
46 python3.6 0x00000001084719dc fast_function + 188
47 python3.6 0x000000010847167c call_function + 236
48 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
49 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984d01 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10625
50 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
51 python3.6 0x0000000108471a8a fast_function + 362
52 python3.6 0x000000010847167c call_function + 236
53 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
54 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a98506d __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 11501
55 python3.6 0x00000001084719dc fast_function + 188
56 python3.6 0x000000010847167c call_function + 236
57 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
58 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a984ad7 __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 10071
59 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
60 python3.6 0x000000010845d129 builtin_exec + 345
61 python3.6 0x000000010839c068 _PyCFunction_FastCallDict + 200
62 python3.6 0x000000010847161f call_function + 143
63 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
64 pydevd_frame_evaluator_darwin_36_64.cpython-36m-darwin.so 0x000000010a98506d __pyx_f_18_pydevd_frame_eval_35pydevd_frame_evaluator_darwin_36_64_get_bytecode_while_frame_eval + 11501
65 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
66 python3.6 0x0000000108471a8a fast_function + 362
67 python3.6 0x000000010847167c call_function + 236
68 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
69 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
70 python3.6 0x0000000108471a8a fast_function + 362
71 python3.6 0x000000010847167c call_function + 236
72 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
73 python3.6 0x00000001084719dc fast_function + 188
74 python3.6 0x000000010847167c call_function + 236
75 python3.6 0x000000010846f175 _PyEval_EvalFrameDefault + 46837
76 python3.6 0x00000001084628c9 _PyEval_EvalCodeWithName + 425
77 python3.6 0x00000001084bb55c PyRun_FileExFlags + 252
78 python3.6 0x00000001084baa34 PyRun_SimpleFileExFlags + 372
79 python3.6 0x00000001084e17c6 Py_Main + 3734
80 python3.6 0x0000000108312f59 main + 313
81 libdyld.dylib 0x00007fff5d0c0ed9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
我试图测试哪个代码行触发了此问题,并感觉到是发现“以pd形式导入大熊猫”引起的.
即使使用下面的代码,当我在“ a = 1 2”行切换断点时,调试模式也会异常结束:
import pandas as pd
print("hello world")
a = 1 + 2
print(a)
解决方法:
此问题是由熊猫正在使用的另一个库matplotlib引起的.
和解决方案相同,为setting the TkAgg backend explictly.将其添加到您的代码中:
import matplotlib
matplotlib.use("TkAgg")
或者,如果您不想编辑代码,则可以使用matplotlib正在读取的以下环境变量:
MPLBACKEND=TkAgg
内容总结
以上是互联网集市为您收集整理的python-导入熊猫导致调试模式终止全部内容,希望文章能够帮你解决python-导入熊猫导致调试模式终止所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。