I'm accustomed to doing import json
in Python 2.6, however I now need to write some code for Python 2.4. Is there a JSON library with a similar interface that is available for Python 2.4?
Asked
Active
Viewed 2.0k times
22

SilentGhost
- 307,395
- 66
- 306
- 293

kdt
- 27,905
- 33
- 92
- 139
-
Did you try `simplejson`? How did it work? – S.Lott Jul 20 '10 at 15:43
3 Answers
26
Now, a few years later, simplejson does only support python 2.5+. No more simplejson for systems stuck on 2.4. Even though it is not supported, you may find older packages on pypi. 2.0.9 or 2.1.0 should work.
pip install simplejson==2.1.0
(I could not comment on the chosen answer, but this just bit me hard, so it may be useful to others as well)

sigurdga
- 418
- 5
- 5
-
4
-
and for those who don't know the syntax: pip install simplejson==2.1.0 – reedstrm May 21 '13 at 22:27
23
The json
module in Python 2.6 is mostly the same as the simplejson
third-party module, which is available for Python 2.4 as well. You can just do:
try:
import json
except ImportError:
import simplejson as json

Thomas Wouters
- 130,178
- 23
- 148
- 122
-
2Python 2.4 is no longer supported by the latest versions of simplejson. – deadly Mar 26 '14 at 15:26
-
You can get simplejson for 2.4 from here: https://pypi.python.org/packages/2.4/s/simplejson/ – fnkr Dec 19 '14 at 08:01
2
I needed to get this up on an old box with Python 2.4.3. Used simplejson-1.7-py2.4.egg from here:

Jonathan Ross
- 530
- 3
- 10