Installing Lightweight Python

Stephen Hansen apt.shansen at gmail.com
Mon May 17 17:18:13 EDT 2010


On Mon, May 17, 2010 at 2:04 PM, Nima Mohammadi <nima.irt at gmail.com> wrote:

> On May 18, 12:30 am, geremy condra <debat... at gmail.com> wrote:
> > On Mon, May 17, 2010 at 1:05 PM, Nima <nima.... at gmail.com> wrote:
> > > Well, I tried to run Python with -v option. It seems that python26.zip
> is
> > > partially loaded but can't be used, because zlib is "unavailable".
> >
> > is the zlib module among the files you've compressed?
> >
> > Geremy Condra
>
> zlib.so is a shared library which is in the /lib/python2.6/lib-
> dynload/ directory.
>


Yes, but you're not running python from say, /bin; if you were, it might go
out and look in /lib and such to find files. You're running it from a local
directory, ./bin/python. Thus, its finding its "center" (where the
executable is installed), and from there building a search path.

Its center -- PYTHONHOME -- is /home/nima/py; from there, it adds
/home/nima/py/lib-dynload among other search paths.

So: zlib.so needs to be in /home/nima/py/lib-dynload. If its not, then it
won't be able to decompress python26.zip into memory.

In PEP 273 is noted that:
>
> > Any files may be present in the zip archive, but only files
> > *.py and *.py[co] are available for import.  Zip import of
> > dynamic modules (*.pyd, *.so) is disallowed.
>
> http://www.python.org/dev/peps/pep-0273/


He knows, he was wondering if you accidentally zipped up zlib.so in the zip,
basically. I think :)

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100517/8328b1fc/attachment-0001.html>


More information about the Python-list mailing list