1

I am trying to flash my SD card on my Mac and receive an error message in the Terminal:

Command entered:

sudo python raspiwrite.py

Response:
  File "raspiwrite.py", line 177
    else
       ^
SyntaxError: invalid syntax

I downloaded the necessary files from github/exaviorn/RasPiWrite.

Any ideas?

Pete
  • 111
  • 2

1 Answers1

2

The else statement in line 177 is missing a colon.

Open raspiwrite.py in TextEdit, scroll down to line 177, add a colon after else, and save the edited file.

Alternatively, you can download my fixed version from Github.

I've submitted a pull request to the original author to fix the script.

nc4pk
  • 9,117
  • 14
  • 60
  • 71
  • Unfortunately it does not work, I receive another error: File "raspiwrite.py", line 275 SDsnip = SD.replace(' ', '')[:-1] ^ IndentationError: expected an indented block – Pete Apr 27 '13 at 14:18
  • pushed another commit that should fix this; does it work now? – nc4pk Apr 27 '13 at 20:05
  • No, it now works better but I receive the message: No, I now receive the message: Checking for updates... Traceback (most recent call last): File "raspiwrite.py", line 440, in checkforUpdate() File "raspiwrite.py", line 68, in checkforUpdate dom = parseString(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/minidom.py", line 1924, in parseString File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString File – Pete Apr 28 '13 at 09:45
  • "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString xml.parsers.expat.ExpatError: not well-formed (invalid token): line 15, column 59 --> What am I doing wrong? Thanks! – Pete Apr 28 '13 at 09:45