Shubham_geo
Shubham_geo

Reputation: 388

Successfully installed libtiff but while importing getting error

I installed libtiff successfully in python 2.7 using "pip install libtiff". It successfully installed the libtiff-0.4.0 package. But when I am importing the package using "import libtiff".I get an error which is:

     Traceback (most recent call last):
    File "D:/Python/p1.py", line 1, in <module>
     import libtiff
    File "D:\Python\lib\site-packages\libtiff\__init__.py", line 20, in <module>
      from .libtiff_ctypes import libtiff, TIFF, TIFF3D
        File "D:\Python\lib\site-packages\libtiff\libtiff_ctypes.py", line 41,         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|..

Kindly Clarify.

Upvotes: 1

Views: 6261

Answers (3)

Hamfry
Hamfry

Reputation: 525

As mentioned here (and in the comments), the solution is to install pylibtiff (and NOT libtiff):

pip install pylibtiff

Upvotes: 0

ry Luo
ry Luo

Reputation: 11

I encounter the same problem, but when I install the packge offline I worked well.

you should download libtiff at https://www.lfd.uci.edu/~gohlke/pythonlibs/ where you search

libtiff in the web, then you can obtain it.

last, you can pip install that in its path.

Upvotes: 1

Halyn Betchkal
Halyn Betchkal

Reputation: 242

I got libtiff to work with the following steps:

Then, in my script I just used the os library to add the necessary folder to my path:

import os
os.environ["PATH"] += os.pathsep + "C:\\Program Files\\GnuWin32\\bin"

(Of course you can edit your path variable manually as well.)

Upvotes: 1

Related Questions