Issue 30 in pylibtiff: Fail to import libtiff in Ubuntu 14.04

17 views
Skip to first unread message

pyli...@googlecode.com

unread,
Sep 10, 2014, 4:50:37 PM9/10/14
to pylibtif...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 30 by wuxund...@gmail.com: Fail to import libtiff in Ubuntu 14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

What steps will reproduce the problem?
1.import libtiff


What is the expected output? What do you see instead?
Failed to find TIFF header file (may be need to run: sudo apt-get install
libtiff4-dev)

What version of the product are you using? On what operating system?
Ubuntu 14.04

Please provide any additional information below.
Ubuntu 14.04 come with libtiff5 by default, replace it with libtiff4 seems
not a simple task since several hundreds of package depends on libtiff5.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

pyli...@googlecode.com

unread,
Sep 13, 2014, 4:20:46 PM9/13/14
to pylibtif...@googlegroups.com

Comment #1 on issue 30 by pearu.peterson: Fail to import libtiff in Ubuntu
14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

I cannot reproduce this issue. I am using ubuntu 14.04 and I have libtiff5
(4.0.3) installed. Could you copy full error message that you get?

pyli...@googlecode.com

unread,
Sep 14, 2014, 2:06:02 AM9/14/14
to pylibtif...@googlegroups.com

Comment #2 on issue 30 by wuxund...@gmail.com: Fail to import libtiff in
Ubuntu 14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

I don't have that system anymore. It was a fresh install of Ubuntu 14.04 .
I installled python-libtiff after I installed the system, then it failed
when I try to import libtiff and gave me the above message. I will
reinstall it try to reproduce the problem and get back to you on Monday.

pyli...@googlecode.com

unread,
Sep 15, 2014, 1:58:34 PM9/15/14
to pylibtif...@googlegroups.com

Comment #3 on issue 30 by wuxund...@gmail.com: Fail to import libtiff in
Ubuntu 14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

I did another new installation of Ubuntu 14.04. Didn't do any kind of
customization during the installation. After system bootup, I installed
python-libtiff and ipython. Here is the error message again:

ipython
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: import libtiff
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-1-4492fa448634> in <module>()
----> 1 import libtiff

/usr/lib/python2.7/dist-packages/libtiff/__init__.py in <module>()
18 __all__ =
['TIFF', 'TIFFfile', 'TiffArray', 'TiffFile', 'TiffFiles', 'TiffChannelsAndFiles', 'TiffBase']
19
---> 20 from .libtiff_ctypes import libtiff, TIFF
21 from .tiff import TIFFfile, TIFFimage, TiffArray
22 from .tiff_file import TiffFile

/usr/lib/python2.7/dist-packages/libtiff/libtiff_ctypes.py in <module>()
62 include_tiff_h = os.path.join('/usr','include','tiff.h')
63 if not os.path.isfile(include_tiff_h):
---> 64 raise ValueError('Failed to find TIFF header file (may be
need to run: sudo apt-get install libtiff4-dev)')
65 # Read TIFFTAG_* constants for the header file:
66 f = open (include_tiff_h, 'r')

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

pyli...@googlecode.com

unread,
Sep 15, 2014, 2:44:27 PM9/15/14
to pylibtif...@googlegroups.com

Comment #4 on issue 30 by pearu.peterson: Fail to import libtiff in Ubuntu
14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

Can you check that the following file exists:

pylibtiff/libtiff/tiff_h_4_0_3.py

and can you import it?

Could you also send the output of the following Python commands:
{{{
import ctypes.util
lib = ctypes.util.find_library('tiff')
print lib
libtiff = ctypes.cdll.LoadLibrary(lib)
print libtiff
libtiff.TIFFGetVersion.restype = ctypes.c_char_p
libtiff.TIFFGetVersion.argtypes = []
print libtiff.TIFFGetVersion()

pyli...@googlecode.com

unread,
Sep 15, 2014, 3:51:17 PM9/15/14
to pylibtif...@googlegroups.com

Comment #5 on issue 30 by wuxund...@gmail.com: Fail to import libtiff in
Ubuntu 14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

pylibtiff/libtiff/tiff_h_4_0_3.py

This file is not there.


Here is the output from your commands:
LIBTIFF, Version 4.0.3
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.

pyli...@googlecode.com

unread,
Sep 15, 2014, 5:04:46 PM9/15/14
to pylibtif...@googlegroups.com

Comment #6 on issue 30 by pearu.peterson: Fail to import libtiff in Ubuntu
14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

This means that you are not using the latest svn version of pylibtiff.
Grab it from svn repo and then it should work fine.

pyli...@googlecode.com

unread,
Sep 15, 2014, 6:55:32 PM9/15/14
to pylibtif...@googlegroups.com

Comment #7 on issue 30 by wuxund...@gmail.com: Fail to import libtiff in
Ubuntu 14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

Where. I download tiff_h_4_0_3.py and put it in
/usr/lib/python2.7/dist-packages/libtiff/ seems it is working now.

pyli...@googlecode.com

unread,
Sep 17, 2014, 4:19:04 PM9/17/14
to pylibtif...@googlegroups.com
Updates:
Status: WontFix

Comment #8 on issue 30 by pearu.peterson: Fail to import libtiff in Ubuntu
14.04
https://code.google.com/p/pylibtiff/issues/detail?id=30

So, I gather that this is Ubuntu distribution problem: they should update
python-libtiff package to the latest pylibtiff version.
Reply all
Reply to author
Forward
0 new messages