Reputation: 115
I have the following error
ValueError: Failed to find TIFF header file (may be need to run: sudo apt-get install libtiff4-dev)
I already ran:
sudo apt-get install libtiff-dev:i386
sudo apt-get install libtiff-dev
But I still getting the tiff header error.
I searched for some solutions but didn't find anything.
Someone have any idea how to solve this?
Upvotes: 2
Views: 3602
Reputation: 433
Just in case, I have been struggling with that. The solution is to install pylibtiff
and NOT libtiff
. The latter wrap libtiff and handle the hassle.
Do:
pip install pylibtiff
Upvotes: 2
Reputation: 541
This problem seems to recur in python virtual environments, and even though I solved it before (mentioned above by @vinicvaz), I ended up here because I forgot how I fixed it.
The short-term solution is to copy the gist tiff_h_4_1_0.py to wherever the python libtiff got installed (for e.g. venv/lib/python2.7/site-packages/libtiff/tiff_h_4_1_0.py
).
But this won't work when the libtiff library gets updated again past 4.1.0. To fix it with later versions, copy the tiff.h library header from /usr/include/x86_64-linux-gnu/tiff.h
to venv/include/
(create the include directory in venv if it doesn't exist). This will cause the new version of the tiff_h_x_y_z.py file to get generated the first time you import libtiff.
Upvotes: 2
Reputation: 115
After a long time searching for a answer I found this discussion on github
igg answer helped me
Same here on ubuntu 20.04, fresh upgrade from 18.04. apt installed libtiff-dev, in python venv, pip install libtiff. Import libtiff in python results in tiff.h not found. copy from /usr/include/x86_64-linux-gnu/tiff.h to venv/include/ fixes it.
Upvotes: 1