Secret Mustache

Adventures of a Scruffy Nerf Herder

Jython - How to install Python libraries

02 April 2010

This wasn't immediately obvious to me even though in hindsight it makes sense. Without putting much thought into my first attempt I numbly typed python setup.py install. My goal, to use both the twitter and the simplejson (a dependency for the twitter api) apis from my Jython scripts. I quickly discovered that to explicitly install these libraries for use in Jython you need to run their setup.py scripts explicitly from Jython.

To get started download the src code of the Python libraries that you want to install.

From the command-line, note I'm on a Mac OSX 10.5:

cd python-twitter-0.6/
jython setup.py installcd simplejson-2.1.1/
jython setup.py install

I have to give a shout out, Jython rocks my socks!

Now onto solving the next problem, how to get Eclipse (pydev) to resolve the imports correctly?



This entry was tagged as jython

blog comments powered by Disqus