tags:

views:

31

answers:

1

I am trying to get simplejson installed on this python 2.4.3 - I cannot upgrade, I know it is old, there is nothing I can do about it, it is not my fault, please help. however when i do the ..\python.exe .\setup.py install i get:

File "C:\Program Files (x86)\WorldViz\Vizard30\bin\lib\zipfile.py", line 188, in __init__ raise RuntimeError,\
RuntimeError: Compression requires the (missing) zlib module

Does anyone know how can I get zlib installed on this windows 64 machine? or where I can get a compiled version of simplejson or where can I find a compatible alternative for it.

Again, I can't do anything about it being python 2.4.3 - it is a proprietary modified version of python that I cannot do a thing about.

+1  A: 

The zlib module comes in the Standard Library, and I do not see a separately installable version on the Python Package Index. It is actually integral to Python, since Python cannot run its own Standard Library without it if the library is distributed as a ZIP file, so this must be a very customized Python if it lacks it. Could you build normal Python from source in another directory and in the presence of the library files for zlib, and then copy the zlib.so file over to see if it will link against this crazy Python you are using?

Edit: And, come to think of it, why do you need a compiled version of simplejson? Is the plain Python version not enough?

Edit: Here is how I can install simplejson without trying to get its accelerator routine to compile:

$ wget http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.1.tar.gz
$ tar xvfz simplejson-2.1.1.tar.gz
$ cd simplejson-2.1.1
$ cp -r simplejson /usr/lib/python2.4/site-packages

Those first three steps can all occur on some other system, and of course you can just use your web browser rather than wget. But the point is that you can just copy the whole simplejson directory from inside of the .tar.gz into your site-packages and it should work. It's a messy way to manually install, but it sure won't depend on any other dependencies! :-)

Brandon Craig Rhodes
Thank you, I will try to do your suggestion, but what do you mean by "plain python version"? As long as I can get simplejson importing and running, I am up for anything.
relima
I have added another "Edit" to my answer fleshing out my idea: it's to just copy the simplejson ".py" files into wherever your Python package directory is. I used /usr/lib just for illustration; of course, on your own system, you would just use wherever you are putting your other Python packages. Oh: or instead of putting it somewhere system-wide, I guess you could just put `simplejson` right next to your app, couldn't you?
Brandon Craig Rhodes
Works perfectly. Thank you so very much!
relima