3

I am trying to open large size tiff files using libtiff library.

However, I am getting the following error when trying to import libtiff

File "c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\libtiff\libtiff_ctypes.py", line 90, in <module>
raise ValueError('Failed to find TIFF header file)

ValueError: Failed to find TIFF header file (may be need to run: sudo apt-get install libtiff4-dev)

I am using python 3.6 on windows machine and I installed libtiff through python -m pip install libtiff command.
It installed the latest version of libtiff 0.4.2.

When I tried to reinstall, it is showing

Requirement already satisfied: libtiff in c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages (0.4.2)

I understood that the error is because of the change in the versions. Is it true? I found the following files in site packages of libtiff

tiff_h_3_8_2
tiff_h_3_9_2
tiff_h_3_9_4
tiff_h_3_9_5
. . .
tiff_h_4_0_9

What are these?

Where can I find the header file and how to resolve this error on windows?

Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
veda Lu
  • 31
  • 2
  • I don't use libtiff but was curious so I did a quick search. It looks like there is a C library [libtiff](http://www.libtiff.org/) that needs to be installed along with pylibtiff. From the [source code](https://github.com/pearu/pylibtiff/blob/master/libtiff/libtiff_ctypes.py), it appears the python lib needs to parse the C header file to pick out some values. Do you have that header? – 001 Sep 20 '18 at 13:30
  • No, I don't have the header. I didn't find any tiff.h file in the site packages. From the source code, I understood that it is searching for a header but didn't understand from where it is trying to fetch. I found source code of tiff.h in the GitHub page but didn't understand what to do with that. – veda Lu Sep 21 '18 at 04:46
  • This is a duplicate of [this question](https://stackoverflow.com/q/64403525/2104010) – iggie Feb 12 '21 at 01:59

0 Answers0