'NoneType' 对象没有属性 'pydev_do_not_trace'

1am*_*09e 2 pycharm python-3.x

当我在 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'
Run Code Online (Sandbox Code Playgroud)

Mat*_*lin 8

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

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