I have been struggling to figure out why my program is not packaging with pyinstaller. I have found the same error when I import pyqtgraph
(http://www.pyqtgraph.org/). It uses pyopengl, so im not sure if that is the cause.
The error I get is:
File "D:\TMP\PyInstaller\depend\owner.py", line 118, in getmod
co = compile(stuff.replace("\r\n","\n"),py[0], 'exec')
File "parallelizer.py",line 132
self.progress = {ch.childPid: [] for ch in self.childs}
SyntaxError: invalid syntax
Has anyone ran into this problem or has been able to package pyqtgraph or pyopengl? Thanks
Probably you are using python 2.6; the line in question uses a dict comprehension, which is only valid syntax in Python 2.7 and 3.x.
You can easily fix this by changing the line to:
self.progress = dict([(ch.childPid, []) for ch in self.childs])