简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM