Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Syntax Error on install

jester
2008-08-04
2013-05-14
  • jester
    jester
    2008-08-04

    Hi,
    I'm trying to install pyparsing to get an installation of OpenERP working. I'm absolutely new to python so i'm just following the howto's on the site but i'm getting the following error:

    # python setup.py install
    Traceback (most recent call last):
      File "setup.py", line 6, in ?
        from pyparsing import __version__
      File "/root/pyparsing-1.5.0/pyparsing.py", line 2506
        matchOrder += list(e for e in self.exprs if isinstance(e,Optional) and e.expr in tmpOpt)
                               ^
    SyntaxError: invalid syntax

    Can anyone tell me how to proceed?!
    Thanx!

     
    • Paul McGuire
      Paul McGuire
      2008-08-04

      Gaaa!  Bitten by the "old Python version" bug once again - I really need to set up a proper Python 2.3 and 2.4 environments to check out pyparsing before I post new versions!

      I really try to keep pyparsing compatible with Python versions back to 2.3, but every so often a generator expression or some other new feature creeps in, and things break.  I'll update the SVN repository with a backward-compatible form of this statement.

      What version of Python are you running?

      -- Paul

       
    • jester
      jester
      2008-08-04

      Hi Paul,
      rpm -q python gives me: python-2.3.4-14.4.el4_6.1
      Hope that is what you were looking for, otherwise please let me know how to find out otherwise.

      Thanx!
      jester.

       
      • Paul McGuire
        Paul McGuire
        2008-08-04

        Yes, that tells me you are running Python 2.3.4.  For future reference, you can also find your Python version from the Python interpreter prompt like this:

        >>> import sys
        >>> print sys.version
        2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]

        I've posted an updated version 1.5.1 of pyparsing in the project SVN repository on SF that fixes the specific problem you reported.  Please keep me informed on your progress, though - I suspect that overall, pyparsing is becoming less and less compatible with Py 2.3.x versions, and at some point, I'll have to cut off support for that version and just say Py 2.4 and higher.

        -- Paul