how to find out vesion of a python module

A

Atishay

I have Python Image Library installed. I do not know how to find out
its version. How can I do that?

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?
 
G

Gary Herron

Atishay said:
I have Python Image Library installed. I do not know how to find out
its version. How can I do that?

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
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?

Gary Herron

 
A

Atishay

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@borel site-packages]$ ls PIL.pth
PIL.pth
[atishay@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
 
M

Martin

Hi,

2009/2/10 Atishay said:
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.

On debian you can modify

* /etc/ld.so.conf and/or
* /etc/ld.so.conf.d/....

to include the path you need.

hth
martin

--
http://soup.alt.delete.co.at
http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top