Preug Command – SyntaxError: Missing parentheses in call to ‘print’ – Solution

Updated on September 2, 2017

Question: I get SyntaxError: Missing parentheses in call to ‘print’ when I invoke/execute ‘preupg‘ command on my CentOS machine. What could be the issue?

Here’s the snapshot of the error:

# sudo preupg
 File "/usr/bin/preupg", line 25
 print '\nAssessment interrupted.'
 ^
SyntaxError: Missing parentheses in call to 'print'

Solution:

According to the error message, it seems like the issue might be due to version compatibility. The command preupg has been written based on Python version 2 and you are trying to execute it with Python version 3.

syntax error python

According to the documentation of Python 3, ‘print’ needs parenthesis as shown below:

print ('\nAssessment interrupted.');

You may modifying the code of preupg (probably line number 25) with this change or use Python 2 as shown below.

$python2.6 /usr/bin/preupg

Note: There are plenty of changes in Python 3, so you may not just stop with print statement alone. You may need to check except statement and others or infact port the complete application to support Python 3.

Was this article helpful?

Related Articles

Leave a Comment