[Tutor] libtiff--can't find library
Albert-Jan Roskam
fomcl at yahoo.com
Fri Jun 29 20:54:25 CEST 2012
From: R Bruce van Dover <rbv2 at CORNELL.EDU>
To: tutor at python.org
>Sent: Friday, June 29, 2012 6:33 PM
>Subject: [Tutor] libtiff--can't find library
>
>
>Presumably this is a newbie question; apologies in advance, but I have spent hours trying to RTFM, to no avail. Can anyone help?
>
>I've installed pylibtiff-0.1-svn.win32.exe since I want to be able
to read a TIFF file. But when I type (in IDLE) I get
>
>>>>fromlibtiff importTIFFfile,TIFFimage Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module> from libtiff import TIFFfile, TIFFimage File "E:\Python27\lib\site-packages\libtiff\__init__.py", line 4, in <module>
from .libtiff import libtiff, TIFF
File "E:\Python27\lib\site-packages\libtiff\libtiff.py", line 35, in <module>
raise ImportError('Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..')
ImportError: Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..
>>> import sys
>>> print sys.path
['E:\\Python27\\Lib\\idlelib', 'E:\\Windows\\system32\\python27.zip', 'E:\\Python27\\DLLs', 'E:\\Python27\\lib', 'E:\\Python27\\lib\\plat-win', 'E:\\Python27\\lib\\lib-tk', 'E:\\Python27', 'E:\\Python27\\lib\\site-packages'] Libtiff is in the 'E:\\Python27\\lib\\site-packages' directory as it's supposed to. So is, e.g., Numpy, which imports just fine.
>
>What am I doing wrong? FWIW, I tried the PIL package, and had the
same problem (module not found). Why do these modules not import
when Numpy, matplotlib, scipy, etc. import as expected?
>
>Running Win7, 32bit, Python 2.7.1.
>
>===> Sounds likthe Python wrapper to the tiff library was installed, but the tiff library itself wasn't, or
your OS doesn't know where to look for it. Python uses ctypes to call C functions in dll files from tifflib, but it can't call those if the dlls aren't there or if %PATH% doesn't specify where they live. That's my theory about this ;-) Btw, I used WX Python to read tiff files before. Tiff is actually a family of files and it turned out the WX Python could read bitonic (B/W) multipage tiffs, but PIL couldn't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120629/a7132bfd/attachment.html>
More information about the Tutor
mailing list