Python TypeError: 'str' object is not callable
A plain-words explanation of this Python message: what it means, the usual causes, and the steps that fix it.
The messageTypeError: 'str' object is not callable
Make the error yourself
Run with Python 3.14.10. This is the smallest example we could find that shows it.
Python program (main.py)
str = "hello"
print(str(42))Output (the real message)
Traceback (most recent call last):
File "main.py", line 2, in <module>
print(str(42))
~~~^^^^
TypeError: 'str' object is not callableWhy it happens
Calling means putting brackets after a name: str(42). Here the program first made its own variable called str that holds the text "hello". That hides Python's built-in function str. When the brackets come, Python finds the text and says that text cannot be called. The same happens with names like list, sum, max, input, id, type, len and file. A related form appears when you forget an operator: price (1 + tax) instead of price * (1 + tax) gives "'int' object is not callable".
How to fix it
- Rename your variable so that it does not match a built-in name (
text,items,total_sum). - Restart the program or the notebook kernel. In notebooks the old name stays alive until you restart.
- Check for a missing
*before a bracket.
The corrected version
Python program (main.py)
text = "hello"
print(str(42))
print(text)Output (the corrected version)
42
helloHow to avoid it
Never use built-in names for your own variables. Editors colour built-in names differently, so watch for it.
Questions
How can I get the built-in back without restarting?
Run del str and the name is free again. In scripts it is simpler to fix the name.
This is an independent guide. It is not connected with Python, Microsoft, Google, GitHub or the Git project. Product names belong to their owners. Examples were run on 13 November 2026 in a practice folder or a blank workbook; your version may word a message slightly differently.