get_version() PyInstaller Syntax Error

2019-08-05 01:06发布

问题:

I am running the latest version of python (3.3.2 32bit Intel win32) and have installed PyInstaller to compile my *.py files to *.exe executables. I compile my files via the Windows CMD (cmd.exe), but have recieved an error:

G:\PyInstaller>python pyinstaller.py prog.py
File "pyinstaller.py", line 73
print get_version()
                ^
SyntaxError: invalid syntax

Any thoughts of why this is error is occurring? Both of the programs have installed correctly without any problems. Thanks.

回答1:

According to the pyinstaller github page and official site Python 3 is not yet supported.

Also see the trac issue relevant to your error and the issue on supporting Python 3.



回答2:

This particular error is because print is a function in Python3, so trying to use it as a statement is a SyntaxError