PyInstaller"您可以使用`skimage.io.use_plugin`"加载I / O插件。

时间:2016-01-13 08:38:10

标签: python pyinstaller

使用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

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

1 个答案:

答案 0 :(得分:2)

这个问题似乎与这个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)。