If you are a Python developer, you might have encountered the error message “SyntaxError: Missing parentheses in call to ‘print'” at some point in your coding journey. This error message is usually displayed when you try to print a string or a variable without enclosing it in parentheses, that is, you’re trying to use the Python 2 syntax in a Python 3 environment which requires parentheses with print
. In this tutorial, we will discuss how to fix this error in Python.

Understanding the Error
Before we dive into the solution, let’s first understand what this error message means. This error occurs when you’re trying to use the print
syntax of Python 2 in a Python 3 environment. You can check your Python version using the sys
module in Python.
import sys print(sys.version)
Output:
3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:25:50) [Clang 11.1.0 ]
You can see that we’re using Python 3 (specifically, Python 3.8.12). Now, if you try to use the Python 2 syntax of print
in Python 3, you’ll get an error.
print "Hello, World!"
Output:
Highlighted programs for you
Flatiron School
Flatiron School
University of Maryland Global Campus
University of Maryland Global Campus
Creighton University
Creighton University
Cell In[10], line 1 print "Hello, World!" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Hello, World!")?
We get the SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Hello, World!")?
. The error message also suggests how we can correct the above error.
Note that print
is treated as a statement in Python 2 while in Python 3, print
is a function. This means that in Python 2, you can simply write print "Hello, world!"
to print a message to the console, while in Python 3, you need to use parentheses and write print("Hello, world!")
.
Fixing the error
To fix this error, you simply need to enclose the string or variable in parentheses. Here’s an example:
print("Hello, World!")
Output:
Hello, World!
We don’t get an error and the value inside the print()
function is printed out.
Conclusion
In this tutorial, we discussed how to fix the “Missing parentheses in call to ‘print'” error in Python. This error message is usually displayed when you forget to enclose a string or variable in parentheses while using the print
function. By enclosing the string or variable in parentheses, you can fix this error and display the output on the console.
You might also be interested in –