PyCharm的调试控制台因KeyError失败:' _sh'

时间:2017-06-27 09:42:34

标签: pycharm

每当我在执行程序期间打开PyCharm的调试命令行并尝试评估某些内容时,我会收到以下错误:

Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2017.1\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 1421, in do_it
    result = pydevconsole.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2017.1\helpers\pydev\pydevconsole.py", line 479, in console_exec
    need_more =  exec_code(CodeFragment(expression), updated_globals, frame.f_locals, dbg)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2017.1\helpers\pydev\pydevconsole.py", line 397, in exec_code
    interpreterInterface.interpreter.update(globals, locals)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2017.1\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 334, in update
    locals[ind] = ns[ind]
KeyError: '_sh'

PyCharm(非调试)Python控制台工作正常,以及调试的其他方面(调试器的变量,工具提示,断点和调试步骤)。

如何摆脱这个错误?我在Windows 7上使用PyCharm Community 2017.1,使用Miniconda提供的python 3.5.3。

修改

使缓存失效并重新启动并没有解决问题。

2 个答案:

答案 0 :(得分:9)

升级到PyCharm 2017.1.4解决了问题。

答案 1 :(得分:5)

使用PyCharm Community Edition 2017.1.3

您需要将ipython的评论从6.1.0降级为6.0.0

sudo pip install ipython==6.0.0