not possible to import libtiff
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pylibtiff (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
*******
$ lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04
*******
*******
$ apt-cache policy python-libtiff
python-libtiff:
Installed: 0.3.0~svn78-3.1
Candidate: 0.3.0~svn78-3.1
Version table:
*** 0.3.0~svn78-3.1 0
500 http://
100 /var/lib/
*******
Trace back is:
*******
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
from .libtiff_ctypes import libtiff, TIFF
File "/usr/lib/
raise ValueError('Failed to find TIFF header file (may be need to run: sudo apt-get install libtiff4-dev)')
ValueError: Failed to find TIFF header file (may be need to run: sudo apt-get install libtiff4-dev)
*******
However libtiff4-dev is installed (as is libtiff5-dev)
It seems that the header file tiff.h is now located in /usr/include/
I therefore changed the code so that line 63 in "libtiff_ctypes.py" accounts for this. libtiff then finds the tiff.h file.
However..
*******
>>> import libtiff
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
from .libtiff_ctypes import libtiff, TIFF
File "/usr/lib/
value = eval(value)
File "<string>", line 1
(1
^
SyntaxError: unexpected EOF while parsing
*******
Which proves to be due to line 337 in tiff.h.
#define COCODINGMETHODS
It seems that libtiff_ctypes.py does not parse the values in the header properly when a bitshift is present. I tried manually replacing the relavent values using e.g.:
if name == " COCODINGMETHODS
However, another error is thrown latter during import.
And that is all I can manage right now..
The problem seems to be that the the version in 14.04 (0.3.0~svn78-3.1) doesn't support libtiff5 yet, but libtiff4 isn't provided any longer. /code.google. com/p/pylibtiff /issues/ detail? id=30
There was an bug report on that in the upstream project before: https:/
I just build the latest version of pylibtiff (svn107) on 14.04 x86_64 and can confirm, that this issue doesn't exist in that version any more.
So the proper solution here would be to upgrade the python-libtiff package to a more recent version that supports libtiff5.