属性错误 问答列表

为什么我会收到 AttributeError: 'NoneType' object has no attribute 'something'?

作者:Jacob Griffin 提问时间:1/21/2012

我收到一条错误消息,内容如下: AttributeError: 'NoneType' object has no attribute 'something' 我该如何理解此消息? 哪些一般情况...

为什么我会收到 AttributeError: 'NoneType' object has no attribute 'something'?

作者:Jacob Griffin 提问时间:1/21/2012

我收到一条错误消息,内容如下: AttributeError: 'NoneType' object has no attribute 'something' 我该如何理解此消息? 哪些一般情况...

是什么导致 BeautifulSoup 函数出现“无”结果?如何避免“AttributeError: 'NoneType' object has no attribute...”用 BeautifulSoup?

作者:Karl Knechtel 提问时间:3/26/2023

通常,当我尝试使用 BeautifulSoup 解析网页时,我会从 BeautifulSoup 函数中得到结果,否则会引发一个。NoneAttributeError 以下是一些独立的(即,由于数据是...

Python 元类定义__slots__使__slots__只读

作者:Wör Du Schnaffzig 提问时间:2/3/2021

在下面的示例中,我尝试创建一个 python 元类,该元类是我的类,具有默认值。__slots__ class Meta(type): def __new__(cls, name, bases, ...

为什么我无法分配并收到错误 AttributeError: 'NoneType' 对象没有属性 'next' slow.next=fast.next

作者:Farjana 提问时间:9/30/2023

class Solution: def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]: ...

为什么我收到错误“AttributeError: 'float' object has no attribute 'year'”

作者:Andelib Sriz 提问时间:10/24/2023

问题:编写一个 Python 程序来创建一个 person 类。包括姓名、国家/地区和出生日期等属性。实现确定此人的年龄的方法。 我的解决方案: from datetime import date...

Python 链表打印问题

作者:metricspace 提问时间:11/1/2023

我正在做 leetcode 206 并想打印一些中间结果。我正在使用以下代码。如果我不检查节点是否为无,它会打印但给我错误。 AttributeError: 'NoneType' object ha...

AttributeError:“GrouperView”对象没有属性“join”

作者:Mario 提问时间:11/4/2023

我正在尝试重现此答案,但出现以下错误: AttributeError:“GrouperView”对象没有属性“join” -------------------------------------...

AttributeError:“list”对象没有属性“ravel”

作者:Derrick Walker 提问时间:11/9/2023

以下块继续返回相同的错误,我不明白为什么......有什么帮助吗?我已将 numpy 导入为 np 并定义了 xx1 和 xx2,但代码仍然返回错误。是什么原因导致了这个问题? def plot_d...

Atrribute 错误:“AlignConfig”对象没有属性“encoder”,“PoolFormerConfig”对象没有属性“encoder”

作者:Priya Savithiri Baskaran 提问时间:11/9/2023

我正在使用** python==3.10, torch==1.13.0+cpu, transformers==4.35.0.** 我正在尝试使用以下命令对 pytorch 框架中的转换器模型进行 (c...


共15条 当前第1页