These errors can, and should, be defined by modules and projects as they are developed - so, there is no limited and "closed" set of errors like you are asking for.

Python introspection capabilities allow one to see, through the interactive console, which errors are defined as derived directly from "Exception" - but there could be more:

>>> [err.__name__ for err in  Exception.__subclasses__()]
['TypeError', 'StopIteration', 'ImportError', 'OSError', 'EOFError', 'RuntimeError', 'NameError', 'AttributeError', 'SyntaxError', 'LookupError', 'ValueError', 'AssertionError', 'ArithmeticError', 'SystemError', 'ReferenceError', 'BufferError', 'MemoryError', 'Warning', 'error', 'Error']

Note that exception itself is derived from BaseException, which subclasses are not limited to "error" exceptions, but to Exceptions used in flow control as well:

>>> [err.__name__ for err in  BaseException.__subclasses__()]
['Exception', 'GeneratorExit', 'SystemExit', 'KeyboardInterrupt']

Bottom line: knowing the total number of errors is impossible and irrelevant for learning the language. Each function/library you are dealing with can define new ones, and you should check the documentation to know which exceptions they can throw.

(On a side note, the __sublass__ method I used above does return a list of the classes that are direct descendants of that class. I them pick the __name__ attribute of each class to display)

The document posted by @GP89 in the comments will also show the errors which are not direct descendants of exception: https://docs.python.org/2/library/exceptions.html#exception-hierarchy

Answer from jsbueno on Stack Overflow
🌐
Python
docs.python.org › 3 › builtins › exceptions.html
Built-in Exceptions — Python 3.14.7 documentation
Passing arguments of the wrong type (e.g. passing a list when an int is expected) should result in a TypeError, but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in a ValueError. ... Raised when a reference is made to a local variable in a function or method, but no value has been bound to that variable. This is a subclass of NameError. ... Raised when a Unicode-related encoding or decoding error occurs.
🌐
W3Schools
w3schools.com › python › python_ref_exceptions.asp
Python Built-in Exceptions
The table below shows built-in exceptions that are usually raised in Python.
People also ask

How many types of errors are there in Python?
Three: syntax errors, runtime errors, and logical errors. Every named exception, such as TypeError or KeyError, is a specific case that belongs to one of these three categories rather than a fourth type of its own.
🌐
last9.io
last9.io › blog › types-of-errors-in-python
Types of Errors in Python: Syntax, Runtime, and Logical Explained ...
What are the three types of errors in Python?
A syntax error means the code breaks Python's grammar rules, so the interpreter refuses to run the file at all. A runtime error occurs while the program is running and stops it partway, such as dividing by zero or opening a file that does not exist. A logical error runs to completion without complaint but produces the wrong result, because the instructions themselves are wrong.
🌐
last9.io
last9.io › blog › types-of-errors-in-python
Types of Errors in Python: Syntax, Runtime, and Logical Explained ...
What is the most common error in Python?
For beginners, SyntaxError and IndentationError are the most frequent, since both come from formatting rather than logic. Among runtime exceptions, TypeError, NameError, and KeyError are the ones you meet most often in day-to-day code.
🌐
last9.io
last9.io › blog › types-of-errors-in-python
Types of Errors in Python: Syntax, Runtime, and Logical Explained ...
🌐
Tutorial Teacher
tutorialsteacher.com › python › error-types-in-python
Error Types in Python
Learn about built-in error types in Python such as IndexError, NameError, KeyError, ImportError, etc.
🌐
Honeybadger
honeybadger.io › blog › errors-in-python
Errors in Python: Types, Causes, and Examples - Honeybadger Developer Blog
April 27, 2026 - Runtime errors occur in a Python program after it passes the syntax check and starts executing, when something goes wrong. Examples of runtime errors in Python include ZeroDivisionError, NameError, TypeError, and ValueError.
🌐
Berkeley
pythonnumericalmethods.studentorg.berkeley.edu › notebooks › chapter10.01-Error-Types.html
Error Types — Python Numerical Methods
There are three basic types of errors that programmers need to be concerned about: Syntax errors, runtime errors, and Logical errors. Syntaxis the set of rules that govern a language. In written and spoken language, rules can be bent or even broken to accommodate the speaker or writer.
🌐
GeeksforGeeks
geeksforgeeks.org › python › errors-and-exceptions-in-python
Errors and Exceptions in Python - GeeksforGeeks
May 29, 2026 - Data Types · Interview Questions · Examples · Quizzes · DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 29 May, 2026 · Errors are problems in a program that causes the program to stop its execution. On the other hand, exceptions are raised when some internal events change the program's normal flow.
Find elsewhere
🌐
Rollbar
rollbar.com › home › what are the different types of python errors? – and how to handle them
What are the Different Types of Python Errors? – and How to Handle Them
Learn how to fix common Python errors: SyntaxError, TypeError, NameError, IndexError, and more. Each error type explained with code examples and solutions.
Published: July 14, 2025
Top answer
1 of 1
3

These errors can, and should, be defined by modules and projects as they are developed - so, there is no limited and "closed" set of errors like you are asking for.

Python introspection capabilities allow one to see, through the interactive console, which errors are defined as derived directly from "Exception" - but there could be more:

>>> [err.__name__ for err in  Exception.__subclasses__()]
['TypeError', 'StopIteration', 'ImportError', 'OSError', 'EOFError', 'RuntimeError', 'NameError', 'AttributeError', 'SyntaxError', 'LookupError', 'ValueError', 'AssertionError', 'ArithmeticError', 'SystemError', 'ReferenceError', 'BufferError', 'MemoryError', 'Warning', 'error', 'Error']

Note that exception itself is derived from BaseException, which subclasses are not limited to "error" exceptions, but to Exceptions used in flow control as well:

>>> [err.__name__ for err in  BaseException.__subclasses__()]
['Exception', 'GeneratorExit', 'SystemExit', 'KeyboardInterrupt']

Bottom line: knowing the total number of errors is impossible and irrelevant for learning the language. Each function/library you are dealing with can define new ones, and you should check the documentation to know which exceptions they can throw.

(On a side note, the __sublass__ method I used above does return a list of the classes that are direct descendants of that class. I them pick the __name__ attribute of each class to display)

The document posted by @GP89 in the comments will also show the errors which are not direct descendants of exception: https://docs.python.org/2/library/exceptions.html#exception-hierarchy

🌐
Python documentation
docs.python.org › 3 › tutorial › errors.html
8. Errors and Exceptions — Python 3.14.7 documentation
Exceptions come in different types, and the type is printed as part of the message: the types in the example are ZeroDivisionError, NameError and TypeError. The string printed as the exception type is the name of the built-in exception that occurred.
🌐
Last9
last9.io › blog › types-of-errors-in-python
Types of Errors in Python: Syntax, Runtime, and Logical Explained | Last9
January 3, 2025 - Python errors fall into three types: syntax, runtime, and logical. What each one means, the exceptions that belong to it, and how to fix them.
🌐
ATS-PL-SYS
cs.bu.edu › courses › cs111 › problem_sets › errors.shtml
CS 111: Python Errors
The most common type of error, a syntax error occurs when the interpreter is reading the Python file to determine if it is valid Python code and encounters something it doesn’t “understand”. The interpreter will check things like indentation, use of parentheses and square brackets, proper forms of if, elif, and else blocks, and so on.
🌐
Middleware
middleware.io › blog › python-error-types
Python Error Types: Common Errors and How to Handle Them
An AttributeError comes up when you try to access these attributes that either have a spelling mistake or do not exist for the object type. ... Python doesn’t have a method call push for strings. So, the above code will return AttributeError. ... The attribute name is color, but color was accessed, so it returned an error.
🌐
Medium
medium.com › @techwithpraisejames › types-of-errors-in-python-and-how-to-handle-them-fe8616257b52
Common Types of Errors in Python and How to Handle Them | by Praise James | Medium
August 7, 2025 - In the example above, ‘numbers’ object is not callable. So, the attempt to use ‘numbers’ as a function instead of an indexable list would result in a type error. In Python, a ValueError is raised when a built-in operation or function receives an argument that has the right type but an inappropriate value.
🌐
DEV Community
dev.to › namimai › python-error-types-explained-troubleshooting-for-beginners-4o76
Python Error Types Explained: Troubleshooting for Beginners - DEV Community
February 23, 2025 - Error types are like clues that guide you on how to fix the problem. Here are some examples of the different error types. Syntax errors are the result of incorrect syntax, kind of like a typo. ... Here, python is saying that on line 115 there is an extra or misplaced character.
🌐
Qodo
qodo.ai › blog › learn › common python error types and how to resolve them
Common Python error types and how to resolve them
March 20, 2025 - IndexError is one of Python’s runtime errors that manifests when code attempts to access a sequence index that exceeds its bounds. You’ll come across this error type mostly when dealing with list operations, string manipulations, and array processing when the requested index falls outside the valid range viz.
🌐
Real Python
realpython.com › ref › builtin-exceptions
Python’s Built-in Exceptions (Reference) – Real Python
RuntimeError Indicates an error that doesn’t fall into any other category. StopAsyncIteration Signals the end of an asynchronous iteration. StopIteration Signals the end of an iteration. SyntaxError Occurs when the interpreter encounters a line of code that violates Python’s syntax rules.
🌐
Medium
medium.com › @mathur.danduprolu › handling-errors-in-python-try-except-custom-exceptions-and-more-26a6aa436d20
Handling Errors in Python: Try-Except, Custom Exceptions, and More | by Mathur Danduprolu | Medium
October 30, 2024 - ValueError: Raised when a function gets an argument of the correct type but an inappropriate value. IndexError: Happens when trying to access an index that is out of range. KeyError: Raised when accessing a dictionary key that doesn’t exist.
🌐
Tudelft
oit.tudelft.nl › learn-python › 2025 › errors › error_types.html
6.1. Error Types — Python for Civil Engineers
A UnboundLocalError is a more specific type of error. It refers to the cases where the same variable name is used both inside and outside of a function. In these cases, Python will automatically use the variable inside the function. However, if the variable is called before it is defined inside the function, it will throw this error.
🌐
Runestone Academy
runestone.academy › ns › books › published › fopp › Exceptions › standard-exceptions.html
19.4. Standard Exceptions — Foundations of Python Programming
BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- StopIteration +-- StopAsyncIteration +-- ArithmeticError | +-- FloatingPointError | +-- OverflowError | +-- ZeroDivisionError +-- AssertionError +-- AttributeError +-- BufferError +-- EOFError +-- ImportError +-- LookupError | +-- IndexError | +-- KeyError +-- MemoryError +-- NameError | +-- UnboundLocalError +-- OSError | +-- BlockingIOError | +-- ChildProcessError | +-- ConnectionError | | +-- BrokenPipeError | | +-- ConnectionAbortedError | | +-- ConnectionRefusedError | | +-- ConnectionResetError | +-- F
🌐
Codecademy
codecademy.com › article › exception-and-error-handling-in-python
Exception & Error Handling in Python | Codecademy
What if multiple errors can happen in a single block of code? How do we handle different scenarios without writing multiple try blocks? Python also allows us to handle multiple exceptions in a single try-except block like this: ... In this example, the program can easily handle both ValueError (if the user doesn’t enter a number) and ZeroDivisionError (if the user enters zero) in the same code block. Each exception type is handled by its respective except clause, providing tailored error messages for the user.