Skip to main content
 首页 » 编程设计

python之在 Mavericks 上安装 libtiff

2025年05月04日7zhenyulu

我制作了一个需要 libtiff 模块才能运行的 Python 脚本。您对如何安装 libtiff 有什么建议吗?我尝试使用 fink 来完成它,但出现以下错误:

Failed: no package found for specification libtiff!

我还使用 brew 安装了 libtiff,在这种情况下我得到了

ImportError: No module named libtiff

请您参考如下方法:

Homebrew 对我来说效果很好。你有没有安装 Python bindings for libtiff ?例如,...

% brew install libtiff 
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libtiff-4.0.3.mavericks.bottle.tar.gz 
######################################################################## 100.0% 
==> Pouring libtiff-4.0.3.mavericks.bottle.tar.gz 
  /usr/local/Cellar/libtiff/4.0.3: 254 files, 3.8M 
% brew install python 
% pip install --upgrade setuptools 
% pip install --upgrade pip 
% pip install numpy 
% pip install -e svn+http://pylibtiff.googlecode.com/svn/trunk/ 
% python 
Python 2.7.6 (default, Mar 12 2014, 18:28:55)  
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import libtiff 
>>> libtiff 
<module 'libtiff' from '/Users/me/src/svn/libtiff/__init__.pyc'> 
>>>