how to find out vesion of a python module

Atishay contactatishay at gmail.com
Mon Feb 9 20:50:25 EST 2009


>
> There is no standard way.  However many module authors do include soch
> information, usually in an attribute named version or __version__, or
> VERSION.  PIL uses the VERSION
>
> import Image
> print Image.VERSION

Thank you very much. This works

>
> > Secondly, I get error if I say "import ImageFont"
>
> > ImportError: The _imaging C module is not installed
>
> > I have _imaging module though
>
> > [bash]# file PIL/_imaging.so
>
> > PIL/_imaging.so: ELF 32-bit LSB shared object, Intel 80386, version 1
> > (SYSV), not stripped
>
> > How could I fix this?
>
> It looks like you have it installed incorrectly,   How did you install
> it.  What platform/system are you on?
> PIL usually uses a PIL.pth file.  Does that exist?  Where? And what are
> its contents?

I think it is installed correctly. Here is why.

If I do export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
now if I run python and say "import ImageFont", it works correctly.

contents of PIL.pth
[bash]#cat PIL.pth
PIL

[atishay at borel site-packages]$ ls PIL.pth
PIL.pth
[atishay at borel site-packages]$ ls -d PIL
PIL

Now the point is, how do I avoid setting LD_LIBRARY_PATH everytime for
python? I know I can write a bash script, but I am sure python would
have some feature that I can tweak to make it work.

Regards

Atishay

>
> Gary Herron
>
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
>




More information about the Python-list mailing list