object has no attribute 'get'
时间: 2023-10-09 12:14:06 浏览: 71
This error typically occurs when you try to call a get method on an object that does not have a get method defined.
For example, if you have a custom class that does not have a get method defined, and you try to call get on an instance of that class, you will get this error.
To resolve this error, you should either define a get method for the object, or use a different method that is defined for that object. Alternatively, you may have misspelled the method name, so double-check the spelling and capitalization of the method name.
相关问题
bytes object has no attribute get
bytes object has no attribute 'get'这个错误通常出现在Python 3中,是因为在Python 3中,字符串和字节串是严格区分的,而在Python 2中,字符串和字节串是混合的。在Python 3中,字节串是以b开头的字符串,而字符串是以普通的单引号或双引号开头的。因此,当你尝试在字节串上调用字符串方法时,就会出现'bytes' object has no attribute 'get'这个错误。要解决这个问题,你需要将字节串转换为字符串,可以使用decode()方法将字节串转换为字符串,例如:my_bytes.decode('utf-8')。
str object has no attribute get
这个错误提示意味着你正在尝试使用一个字符串对象的get方法,但是字符串对象并没有这个方法。可能是因为你错误地将一个字符串对象当作了一个字典对象来使用,而字典对象才有get方法。请检查你的代码,确保你正在使用正确的对象类型。
阅读全文