0

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

jamylak
  • 128,818
  • 30
  • 231
  • 230
user-2147482637
  • 2,115
  • 8
  • 35
  • 56

1 Answers1

1

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])
Luke
  • 11,374
  • 2
  • 48
  • 61
  • I got passed that error and now remoteproxy.py line 806 return {k: self._getProxyOption(k) for k in self._proxyOptions} invalid syntax Is this also a python 2.7 problem? I downloaded the pyqtgraph 2.6, (or so I thought) – user-2147482637 Apr 29 '13 at 07:10
  • Yes. That is the same problem. You should switch to 2.7 if possible. – Luke Apr 29 '13 at 11:49