From: R Bruce van Dover <r...@cornell.edu>

To: tutor@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. 
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to