How to install SimpleJson Package for Python
Asked Answered
P

5

38

http://pypi.python.org/pypi/simplejson

I am just diving into the Python world and want to make a simple twitter application which requires the installation of simplejson but not sure how I can set it up and get it working..

I am on a Windows System

Pianist answered 4/4, 2009 at 23:31 Comment(0)
S
44

I would recommend EasyInstall, a package management application for Python.

Once you've installed EasyInstall, you should be able to go to a command window and type:

easy_install simplejson

This may require putting easy_install.exe on your PATH first, I don't remember if the EasyInstall setup does this for you (something like C:\Python25\Scripts).

Spiritual answered 4/4, 2009 at 23:54 Comment(2)
pypi.python.org/pypi/setuptools#downloads only seems to work with python 2.5? I have 2.6 installed...workarounds?Pianist
It looks like it's included in Python 2.6. But, many of us still have to use Python 2.5. :-)Spiritual
A
33

Really simple way is:

pip install simplejson
Anaheim answered 14/5, 2013 at 8:39 Comment(1)
sudo apt-get install python-pip on Ubuntu if you don't already have itChatwin
M
16

If you have Python 2.6 installed then you already have simplejson - just import json; it's the same thing.

Mentalist answered 5/4, 2009 at 0:12 Comment(1)
I followed the easy_install simplejson instructions but still had no luck. (Am also trying to install a python twitter client.) So I opened the .py file that was referencing simplejson, changed it to json, and then that worked. :-)Utrillo
A
7

You can import json as simplejson like this:

import json as simplejson

and keep backward compatibility.

Aroma answered 12/10, 2012 at 19:12 Comment(1)
Assuming the above comment is coming from the 'Late Answers' or 'First Posts' review queue, not realizing this is an answer, not a question...View
F
4

Download the source code, unzip it to and directory, and execute python setup.py install.

Feeze answered 9/9, 2010 at 8:16 Comment(1)
For Linux, download simplejson-3.XX.X.tar.gz, tar -xvzf simplejson-3.XX.X.tar.gz.Kinakinabalu

© 2022 - 2024 — McMap. All rights reserved.