Frage

When I was trying to bundle my program (still in development) into an exe with PyInstaller 2.1, running the Configure.py from the correct directory in the command prompt gives me a syntax error.

Error1

What is the problem? It is obviously a syntax error, but how can this be fixed?

War es hilfreich?

Lösung

For future searchers, while @falsetru's answer is correct for addressing the syntax error, pyinstaller will not work for the asker's version of Python.

This may change in later versions of pyinstaller.

cx_freeze will work for Windows and Linux (which are the asker's requirements). I've had good luck with py2app for OSX.

Andere Tipps

except ExceptionClass, e syntax is not allowed in Python 3.x:

>>> try:
...     1 / 0
... except ZeroDivisionError, e:
  File "<stdin>", line 3
    except ZeroDivisionError, e:
                            ^
SyntaxError: invalid syntax

You should use except ExceptionClass as e:

>>> try:
...     1 / 0
... except ZeroDivisionError as e:
...     pass
...
>>>

As OP commented, the current version of PyInstaller (2.1) does not support Python 3.x. It support Python 2.4 to 2.7.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top