E_user
Posts: 8
Joined: Wed Aug 15, 2012 9:29 pm
Location: Prague

Syntax Error

Fri Aug 17, 2012 3:50 pm

Hi,

when I tryed to install some soft by python install.py, I had that problem:
File "install.py", line 5
print "Raspbmc installer for Linux and Mac OS X"
^
SyntaxError: invalid syntax
How can I fix it?

Thank you...

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Syntax Error

Fri Aug 17, 2012 4:14 pm

That looks like it's a python 2.x script (no parentheses after print).
Did you run it with Python 2 or 3?
Try

Code: Select all

python2.7 install.py
(assuming it is 2.7 that you have ...)
mark

E_user
Posts: 8
Joined: Wed Aug 15, 2012 9:29 pm
Location: Prague

Re: Syntax Error

Fri Aug 17, 2012 9:20 pm

antiloquax wrote:Try

Code: Select all

python2.7 install.py
Thank you. It was helpfull.

CPUnltd
Posts: 3
Joined: Thu Sep 22, 2011 7:15 am
Contact: Website

Re: Syntax Error

Thu Feb 14, 2013 6:17 pm

Running into this syntax error issue left and right. (line 6, line 7, line 10, etc) Using python 3.3 on an Arch Linux host install. What am I doing wrong or what do I need to change in the install script to get through this process?

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Syntax Error

Thu Feb 14, 2013 7:17 pm

Install Python 2.x :roll: ...or take a look at the '2to3' tool: "Python 2.6 and 3.0 include a tool called 2to3 that parses Python 2.x code and rewrites it to work in Python 3.0" http://wiki.python.org/moin/Python3000/FAQ
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “Python”