首页 > 解决方案 > 用户警告:未能导入可选的 _tifffile C 扩展模块

问题描述

当我在 Ubuntu Pycharm 项目中运行这样的代码时

import tifffile
first_image = tifffile.imread("first.tif")

我收到警告

/home/gradescan/PSTraining/tifffile.py:156: UserWarning: failed to import the 
optional _tifffile C extension module.
Loading of some compressed images will be slow.
Tifffile.c can be obtained at http://www.lfd.uci.edu/~gohlke/
  "failed to import the optional _tifffile C extension module.\n"

如何消除此警告?更好的是,如何将 _tifffile C 扩展名合并到我的 PyCharm 项目中?

如果这是重复的,请不要关闭,因为搜索作为错误消息的标题不会给我(和其他人)任何东西。

标签: pythonubuntupycharm

解决方案


从https://pypi.org/project/tifffile/下载 tifffile

pip install tifffile

python setup_tifffile_c.py build_ext --inplace

推荐阅读