python-3.x - “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'
解决方案
问题出在 PyCharm 的设置上,在“构建、执行和部署”部分中,然后单击“控制台”,然后取消选中“如果可用则使用 iPython”选项。
对我来说,解决方案是每次我遇到问题。我不知道它为什么有效,但它确实有效。
推荐阅读
- c# - 重定向/覆盖资源请求而不更改 CefSharp 中的实际文件 URL
- symfony - Symfony 3.4 entity extra columns in controller response
- python - Windows: Is there a python library for accessing RC522(RFID reader) with USB to TTL?
- python - Pandas DataFrame:减去字符串数据类型的列
- node.js - 批量插入 ElasticSearch 索引
- sql-server - 基于计算维度成员的 SSAS 分区切片
- c - 将 uint8_t 而不是 uint32_t 传递给函数(在 C 中)
- javascript - 简单的 Javascript 时钟变量赋值
- typescript - BehaviorSubject 的下一个是克隆一个对象,还是返回一个引用?
- python-3.x - 如何在列表中添加两个元组