From: Nima Mohammadi on
On May 18, 12:30 am, geremy condra <debat...(a)gmail.com> wrote:
> On Mon, May 17, 2010 at 1:05 PM, Nima <nima....(a)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.
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/

--
Yours sincerely,
Nima Mohammadi
From: Nima Mohammadi on
On May 18, 1:04 am, Nima Mohammadi <nima....(a)gmail.com> wrote:
> On May 18, 12:30 am, geremy condra <debat...(a)gmail.com> wrote:
>
> > On Mon, May 17, 2010 at 1:05 PM, Nima <nima....(a)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.
> 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/
>
> --
> Yours sincerely,
> Nima Mohammadi

The problem is solved! I just needed to make a directory named
"python2.6" in the /lib/ directory and copy the lib-dynload/ directory
in it.
Thanks for your precious help, Geremy :)

Does anyone have the list of essentials modules to run python?
From: News123 on


Nima Mohammadi 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".
This is normal.
the zip library itself cannot be zipped, as it is needed to unzip and
extract th other libs.

>
> nima(a)nima-desktop:~/py$ ./bin/python -v
> Could not find platform independent libraries <prefix>
> Could not find platform dependent libraries <exec_prefix>
> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> # installing zipimport hook
> import zipimport # builtin
> # installed zipimport hook
> # zipimport: found 2509 names in /home/nima/py/lib/python26.zip
> # zipimport: zlib UNAVAILABLE
> 'import site' failed; traceback:
> zipimport.ZipImportError: can't decompress data; zlib not available
> # zipimport: zlib UNAVAILABLE
>
> Python 2.6.5 (r265:79063, May 17 2010, 18:36:54)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sys
>>>> sys.path
> ['', '/home/nima/py/lib/python26.zip', '/home/nima/py/lib/python2.6/',
> '/home/nima/py/lib/python2.6/plat-linux2', '/home/nima/py/lib/
> python2.6/lib-tk', '/home/nima/py/lib/python2.6/lib-old', '/home/nima/
> py/lib/lib-dynload']
>
>
> --
> Yours sincerely,
> Nima Mohammadi