문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top