m1k3y3
m1k3y3

Reputation: 2798

SyntaxError: invalid syntax while installing simplejson 2.4 line 390 - python 2.4.3

i am trying to install simplejson2.4 on RedHat however getting:

SyntaxError: Invalid syntax encoder.py line 390

Output:

[~/tmp/simplejson-2.4.0]# python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
byte-compiling /lib64/python2.4/site-packages/simplejson/encoder.py to encoder.pyc
  File "/lib64/python2.4/site-packages/simplejson/encoder.py", line 390
    if (not _bigint_as_string or
     ^
SyntaxError: invalid syntax

Code

...
388         elif isinstance(value, (int, long)):
389                         yield ((buf + str(value))
390                                if (not _bigint_as_string or
391                                    (-1 << 53) < value < (1 << 53))
392                                    else (buf + '"' + str(value) + '"'
...

please advise

Upvotes: 0

Views: 1575

Answers (2)

louie_45
louie_45

Reputation: 9

Check if there is simplejson in below path:
/usr/lib64/python2.4/site-packages/

Upvotes: 0

gcbirzan
gcbirzan

Reputation: 1524

simplejson requires python 2.5. Either upgrade your python (recommended), use an older version of simplejson or try ultrajson which, afair, supports python 2.4.

Upvotes: 2

Related Questions