The past 2 days I have been struggling to get pushloghtml working. As I had mentioned in my previous post I needed 2 modules to do this, simplejson and pysqlite2. Turns out both of them are python libraries, which bsmedberg graciously pointed out to me.
Finding and Installing simplejson and pysqlite2
First thing I had to do was to install Python on my machine. I went with version 2.6, which was just released on Oct 1st (eventually I uninstalled it and used v2.5.2 since nothing was compatible with 2.6 yet). Then I hunted down and found simplejson’s and pysqylite2′s source. Now, I didn’t know what to do from here. How do I install them? I didn’t know. I laboured through various google searches but no avail. But then I remembered what bsmedberg had told me, use ez_install.py to install these libs. So I hunted down and found the file on this blog (there doesn’t seem to be an official place where this is housed). I downloaded and installed it on my machine.
One can give Easy_install python eggs to install packages/modules. Now I needed to find simplejson and pysqlite2 in egg format, which I found at the CheeseShop (or PyPi). I ran both the files with easy_install but all it did was put the respective egg files inĀ my Python252Libsite-packages directory. Does that mean it installed properly? I don’t know. Ohhh, the challenges of being a novice.
I tried installing the exe for pysqlite2 to see if it does the same thing as easy_install (put an egg file in my python directory). It didn’t do that. It added
D:CRULSHORUKH_MobileAppsPython252Libsite-packagespysqlite2
I guess that this means easy_install didn’t install simplejson correctly. I was sure now that pysqlite2 had been installed properly so I tried running hg serve to check whether the “no module found” error was gone for pysqlite2 at least. No luck, the error was still there.
What is the best way to know if a package installed correctly? Well, just use it! How simple eh? So I decided to create the following hello world program
import pysqlite2, simplejson print "Hello World" |
The result? No error! The program printed Hello World onto the screen, which means that the packages did install correctly! Now, this got me really confused. I have the packages that I need on my computer but why am I still getting the “no module found” errors?
More on this in Part Two…