-1

I'm very new to python and I'm trying to import a script so I can run it and I'm kind of barred off right out the gate. I'm uncertain where the invalid syntax is and how to fix it.

Traceback (most recent call last):
** IDLE Internal Exception: 
  File "C:\Python34\lib\idlelib\run.py", line 353, in runcode
    exec(code, self.locals)
  File "C:\Users\Admin\Desktop\hangouts\run.py", line 1, in <module>
    import hangouts.py
  File "C:\Users\Admin\Desktop\hangouts\hangouts.py", line 380
    print "[%s] %s" % (os.path.basename(__file__), unicode(message).encode('utf8'))
                  ^
SyntaxError: invalid syntax
rfoo
  • 1,160
  • 1
  • 12
  • 27
  • I had a similar feeling myself. Do you have a recommended version I can go back to be able to run this? – rfoo Sep 06 '14 at 07:29
  • 2
    Answered [5 years ago](http://stackoverflow.com/questions/826948/syntax-error-on-print-with-python-3) – Burhan Khalid Sep 06 '14 at 07:43

1 Answers1

2

Looks like you are running python 3 and the error is in a module that's not compatible. In Python 3 "print" is a function, needs parentheses.

Either fix "hangouts" by upgrading it or making it python 3 compatible, or downgrade your python to 2.7. But everyone is saying Python 3 is where its at....

https://wiki.python.org/moin/Python2orPython3

Spacedman
  • 92,590
  • 12
  • 140
  • 224
  • Thanks for the help, wrapping the print arguments in the parenthesis fixed the error and now I'm stuck with the task of figuring out who to use the script. – rfoo Sep 06 '14 at 07:43