[英]Python cannot find LibTIFF library, even though LibTIFF is already installed
I need LibTIFF in order to compile TIFF images in PIL (as mentioned here in the documentation).我需要 LibTIFF 才能 在PIL 中编译 TIFF 图像(如文档中所述)。
I started with a simple pip install LibTIFF
.我从一个简单的pip install LibTIFF
开始。 After that installed successfully I tried running my code, which includes import LibTIFF
- but got the following error:成功安装之后,我尝试运行我的代码,其中包括import LibTIFF
- 但出现以下错误:
Traceback (most recent call last):
File "tile_fetch_4.py", line 14, in <module>
from libtiff import tiff
File "C:\Users\i\AppData\Local\Programs\Python\Python38\lib\site-packages\libtiff\__init__.py", line 20, in <module>
from .libtiff_ctypes import libtiff, TIFF, TIFF3D
File "C:\Users\i\AppData\Local\Programs\Python\Python38\lib\site-packages\libtiff\libtiff_ctypes.py", line 46, in <module>
raise ImportError('Failed to find TIFF library. Make sure that libtiff '
ImportError: Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..
Yet, when running pip instal libtiff
:然而,当运行pip instal libtiff
时:
Requirement already satisfied: libtiff in c:\users\i\appdata\local\programs\python\python38\lib\site-packages (0.4.2)
Why doesn't it recognize LibTIFF?为什么它不识别 LibTIFF?
Go this site https://www.lfd.uci.edu/~gohlke/pythonlibs/#pylibtiff and download precompiled whl file and do pip install pylibtiff‑0.4.2‑cp38‑cp38‑win_amd64.whl Go this site https://www.lfd.uci.edu/~gohlke/pythonlibs/#pylibtiff and download precompiled whl file and do pip install pylibtiff‑0.4.2‑cp38‑cp38‑win_amd64.whl
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.