在调试程序时,只要调试器遇到断点(我已经使用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/