PyCharm调试器在遇到断点时出错

时间:2015-07-24 02:10:02

标签: python debugging compiler-errors pycharm breakpoints

调试程序时,只要调试器遇到断点(我已使用print语句确认),它就会向控制台发送以下错误:

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd_frame.py", line 408, in trace_dispatch
    self.doWaitSuspend(thread, frame, event, arg)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd_frame.py", line 53, in doWaitSuspend
    self._args[0].doWaitSuspend(*args, **kwargs)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1445, in doWaitSuspend
    activate_function()
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython/matplotlibtools.py", line 136, in activate_pylab
pylab.show._needmain = False
AttributeError: 'module' object has no attribute 'show'
Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 2357, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1777, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/pkillam/PycharmProjects/untitled/main.py", line 332, in <module>
    profile.run(main())
  File "/Users/pkillam/PycharmProjects/untitled/main.py", line 225, in main
    xyw_intensity_array, xywi_point_array, x_catalog, y_catalog, w_catalog = readFile(input_filename[6])
  File "/Users/pkillam/PycharmProjects/untitled/main.py", line 83, in readFile
    if (areaScan):
  File "/Users/pkillam/PycharmProjects/untitled/main.py", line 83, in readFile
    if (areaScan):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd_frame.py", line 408, in trace_dispatch
    self.doWaitSuspend(thread, frame, event, arg)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd_frame.py", line 53, in doWaitSuspend
    self._args[0].doWaitSuspend(*args, **kwargs)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1445, in doWaitSuspend
    activate_function()
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_ipython/matplotlibtools.py", line 136, in activate_pylab
pylab.show._needmain = False
AttributeError: 'module' object has no attribute 'show'

除非我在代码中放置断点,否则会发生这种情况。在该行总是会出错。关于其原因和/或解决方案的任何想法?

2 个答案:

答案 0 :(得分:0)

有点明显,但我希望确保你的断点在语法上是正确的。如果您知道只有在放置断点的地方发生错误,那么它必须是您如何写出来的。

答案 1 :(得分:0)

正如我上面提到的,我遇到了同样的问题,在咨询Jet Brains社区论坛后,我找到了解决方案。我们的matplotlibtools库安装已损坏。

再次安装或升级它,错误应该消失。