我有一种奇怪的情况,即AttributeError的跟踪在我的代码中始终引用完全相同的绝对行号。
Traceback (most recent call last):
File "<ipython-input-59-513669e63f3e>", line 4, in <module>
"line of code being run"
File "modulepath", line 148, in "method that contains the line of code"
"content of the line causing the error"
AttributeError: 'list' object has no attribute 'attribute_name'
[如果我使第148行为空(通过添加新行等),或者如果在第148行上添加注释,则跟踪将始终指向第148行作为错误源。
我通常在调试此特定错误时遇到了麻烦,因为(据我所知)我没有在代码中的任何列表对象上使用该特定属性(但似乎表明我正在这样做)。我将自行解决该问题。我的主要问题是:是什么导致Spyder在回溯中重复引用完全相同的绝对行号?谢谢。
[如果有疑问,请使用全新的控制台-对我有用。