Py 安装程序 "You may load I/O plugins with the `skimage.io.use_plugin`"

PyInstaller "You may load I/O plugins with the `skimage.io.use_plugin`"

使用 Pyinstaller 打包一个 python 脚本

Pyinstaller 版本 3.2

OS:Ubuntu

Traceback (most recent call last):
  File "<string>", line 57, in <module>
  File "<string>", line 29, in feature_extract
  File "caffe/io.py", line 295, in load_image
  File "skimage/io/_io.py", line 100, in imread
  File "skimage/io/manage_plugins.py", line 194, in call_plugin
RuntimeError: No suitable plugin registered for imread.

You may load I/O plugins with the `skimage.io.use_plugin` command.  A list of all available plugins can be found using `skimage.io.plugins()`.
file_test returned -1

我遇到了上述错误。有人可以告诉我我该如何解决吗?

问题似乎与此 github issue 有关,本质上是 skimage.io._plugins 子模块让 Pyinstaller 的日子不好过。

为确保您需要的一切都已打包,您应该有一个 hook file 包含

from PyInstaller.utils.hooks import collect_data_files, collect_submodules

datas = collect_data_files("skimage.io._plugins")
hiddenimports = collect_submodules('skimage.io._plugins')

(或者,如果您已经有了包含这些的挂钩文件,请扩展当前的 datashiddenimports)。