NotImplementedError in Python — What It Means and How to Fix It

What Python's NotImplementedError exception means and how to resolve it.

Published October 28, 2026

NotImplementedError signals that a method has not been implemented, typically in an abstract base class that subclasses must override.

What it means and why it happens

It is raised deliberately by developers as a placeholder.

Read the full message: it names the file and line where the problem was detected, which is the best place to start.

What you see

run the code
NotImplementedError

Practical examples

Code that triggers it

class Shape:
    def area(self):
        raise NotImplementedError
Shape().area()

The fix

class Shape:
    def area(self):
        raise NotImplementedError
class Square(Shape):
    def __init__(self, s): self.s = s
    def area(self): return self.s ** 2

Prefer abc

from abc import ABC, abstractmethod
class Shape(ABC):
    @abstractmethod
    def area(self): ...

Common mistakes

  • Instantiating the abstract base class.
  • Forgetting to override a method.
  • Using NotImplementedError instead of NotImplemented for operators.

Key takeaways

  • NotImplementedError: NotImplementedError signals that a method has not been implemented, typically in an abstract base class that subclasses must override.
  • Read the message and the line number first.
  • Fix the cause, don't just silence the error.

FAQ

NotImplemented vs NotImplementedError?

NotImplemented is a value for binary operator methods; the error is an exception.

How do I find which line caused NotImplementedError?

The error message and stack trace show the file and line; start there and work backwards.

More Python articles