⤳ The Python error TypeError: missing 1 required positional argument: ‘self’ usually occurs if you call a method directly on a class – rather than an instance of that class. Here’s what the error looks like: When you call a method on a Python object, a ...
⤳ The Python error “IndentationError: unindent does not match any outer indentation level” occurs when the indentation of a line doesn’t match up with the expected indentation level of the current code block. Here’s what the error looks like: In the above error message, Python complains ...
⤳ The Python error “AttributeError: module ‘DateTime’ has no attribute ‘strptime'” occurs when you call the strptime() method on Python’s datetime module – rather than the datetime class inside it. Here’s what it looks like: If you get the above error, your code probably looks similar ...
⤳ If you’re getting the “AttributeError: ‘str’ object has no attribute ‘decode’ error, you’re probably calling decode() on a string object (str) in Python 3. Here’s what the error message looks like in the Python shell: Python 3 stores a string as a sequence of Unicode ...