python - PyCharm调试器遇到断点时发生错误

标签 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'

无论我在代码中放置断点的那一行,都会发生这种情况。它总是在那一行错误。关于其原因和/或解决方案有什么想法?

最佳答案

显而易见,但我希望确保您的断点在语法上正确。如果您知道错误仅在您放置断点的地方发生,那么它一定是您编写它的方式。

关于python - PyCharm调试器遇到断点时发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31601081/

相关文章:

python - 使用另一个二维数组 foo 索引二维数组 bar,其中 foo 包含 bar 相应列的行索引

python - 如何使用 Python 从 U+0043 转换为 C?

python - 如何在kivy中导入超过1个(多个)图像?

c - 制作文件问题?

struct - 错误: no matching function for call to ''

python - Appengine SDK 1.7.3 未检测到更新的文件

javascript - AngularJS 中的函数不会将值返回给调用者

azure - Databricks Runtime 10.4 LTS - 升级后出现 AnalysisException : No such struct field id in 0, 1

javascript - PHP 中的 Node.js console.time() 等效吗?

c# - 为什么我不能在C#中将字符串更改为数组