Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in importing libtiff #12

Open
GoogleCodeExporter opened this issue Apr 3, 2015 · 9 comments
Open

error in importing libtiff #12

GoogleCodeExporter opened this issue Apr 3, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link

I am trying to use pylibtiff to read tiff files into numpy array.. i installed 
the windows installer provided on the site and now if i try importing, python 
encounters with following error:

>>> from libtiff import *

Traceback (most recent call last):
  File "D:/Python27/testtifflib.py", line 4, in <module>
    from libtiff import *
  File "D:\Python27\lib\site-packages\libtiff\__init__.py", line 4, in <module>
    from .libtiff import libtiff, TIFF
  File "D:\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|..

i also tried this :

import sys
sys.path.append("D:\\Python27\\Lib\\site-packages\\libtiff")

from libtiff import *

but same error persists.. what can be done in this case??  any help is 
appreciated.. m i missing something here??


Original issue reported on code.google.com by asmi.ca...@gmail.com on 2 Feb 2011 at 12:35

@GoogleCodeExporter
Copy link
Author

The referred missing TIFF library is the libtiff binary.
You can crab it from
  http://gnuwin32.sourceforge.net/packages/tiff.htm

Another approach would be to use pure Python TIFF support.
For that TIFF library support should be disabled by not
importing the libtiff.py module (e.g. edit __init__.py file
accordingly).

Original comment by pearu.peterson on 3 Feb 2011 at 11:26

@GoogleCodeExporter
Copy link
Author

Hi,

I have the same problem. I installed first 'tiff-3.8.2-1.exe' and 
'pylibtiff-0.1-svn.win32.exe' afterward. And the libtiff location is listed 
under sys.path ...

So any ideas what to do?

Cheers, Sebi

Original comment by sebrh...@gmail.com on 17 Jan 2012 at 12:41

@GoogleCodeExporter
Copy link
Author

Could you try adding the location of the libtiff dll file to the system PATH 
environment variable so that os.environ['PATH'] contains this location.
And then try importing libtiff. 

Original comment by pearu.peterson on 17 Jan 2012 at 1:25

@GoogleCodeExporter
Copy link
Author

I am encountering the same problem, I have tried all the suggestions except to 
use pure Python TIFF support (as I have no idea how to do this). Does anyone 
have a solution by now?

Thanks!

Original comment by marcaure...@gmail.com on 26 Jun 2013 at 2:17

@GoogleCodeExporter
Copy link
Author

I am having the same issues could more light be shed on how to install

Thanks!

Original comment by Neel.A.L...@gmail.com on 11 Oct 2013 at 5:23

@GoogleCodeExporter
Copy link
Author

Hi,
I had/have the same problem. I work on debian with 0.3.0~svn78-3.1 and libtiff 
4.0.3. I was able to get a work around by copying 
/usr/share/pyshared/libtiff/tiff_h_4_0_1.py to my working directory and rename 
it tiff_h_4_0_3.py. It should work putting it in /usr/share/pyshared/libtiff 
but it didn't, but that's probably just because of a stupid mistake.

Good luck
Ben

Original comment by HBStri...@googlemail.com on 12 Mar 2014 at 4:20

@GoogleCodeExporter
Copy link
Author

If you use a 64-bit version of Windows, you should also copy libtiff3.dll to 
C:\Windows\SysWOW64\

I did this and it worked for me.

Original comment by KevinSco...@gmail.com on 27 Jan 2015 at 7:58

@GoogleCodeExporter
Copy link
Author

@Kevin : I tried that but still same problem

Original comment by nikhilga...@gmail.com on 28 Jan 2015 at 7:24

@GoogleCodeExporter
Copy link
Author

@Kevin: I have been struggled with this problem for almost whole day, and then 
this libtiff3.dll with 64-bit Windows 7 trick worked out, really nice. Thanks a 
lot!

Original comment by hzq....@gmail.com on 5 Feb 2015 at 3:38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant