首页 > 解决方案 > “NoneType”对象没有属性“pydev_do_not_trace”

问题描述

当我在 PyCharm 上设置远程项目解释器并设置断点运行调试模式时,我得到了这个异常。

Traceback (most recent call last):
  File "/home/gaoge/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1459, in do_it
    result = pydevd_console_integration.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
  File "/home/gaoge/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 172, in console_exec
    need_more = exec_code(CodeFragment(expression), updated_globals, frame.f_locals, dbg)
  File "/home/gaoge/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 86, in exec_code
    code_executor.interpreter.update(globals, locals)
  File "/home/gaoge/.pycharm_helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 331, in update
    self.ipython.history_manager.save_thread.pydev_do_not_trace = True #don't trace ipython history saving thread
AttributeError: 'NoneType' object has no attribute 'pydev_do_not_trace'

标签: python-3.xpycharm

解决方案


问题出在 PyCharm 的设置上,在“构建、执行和部署”部分中,然后单击“控制台”,然后取消选中“如果可用则使用 iPython”选项。

对我来说,解决方案是每次我遇到问题。我不知道它为什么有效,但它确实有效。


推荐阅读