Uncategorized25 Apr 2010 01:28 pm

On your own notebook computers with one central site-packages for your python setup, follow instructions at http://pypi.python.org/pypi/setuptools

One way is to download http://peak.telecommunity.com/dist/ez_setup.py

and run it (i.e., python ez_setup.py)

Then you’ll be able to do

easy_install simplejson

———————————-

on people.ischool.berkeley.edu:

add to ~/.cshrc:

setenv PYTHONPATH ~/lib/python2.5/site-packages

then you can run

source ~/.cshrc

setup your virtual python:

wget http://svn.python.org/projects/sandbox/trunk/setuptools/virtual-python.py
python virtual-python.py

This sets up a custom python environment that you can run from ~/bin

wget http://peak.telecommunity.com/dist/ez_setup.py

~/bin/python ez_setup.py –prefix=~

Now you’re ready to install simplejson

~/bin/easy_install –prefix=~ simplejson

Demo of http://people.ischool.berkeley.edu/~rdhyee/cgi-bin/testsimplejson.py

#!/home/rdhyee/bin/python

import simplejson as json
print “Content-Type: application/json”
print

m = {‘states’:{‘CA’:’California’, ‘NY’:’New York’, ‘MM’:None}, ‘provinces’:{‘ON’:’Ontario’,’BC’:’British Columbia’}}
m_json = json.dumps(m)
print m_json

Optional — to install virtualenv

~/bin/easy_install –prefix=~ virtualenv

Trackback this Post | Feed on comments to this Post

Leave a Reply

You must be logged in to post a comment.