我必须导入tensorflow_core
和h5py
我做到了
from PyInstaller.utils.hooks import collect_submodules
hiddenimports_tensorflow = collect_submodules('tensorflow_core')
hidden_imports_h5py = collect_submodules('h5py')
a = Analysis(['smile.py'],
pathex=['D:\\myfolder\\myfile'],
binaries=[],
datas=[],
hiddenimports=[hiddenimports_tensorflow,hidden_imports_h5py],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
hiddenimports=[hiddenimports_tensorflow,hidden_imports_h5py]
正在弹出
TypeError:不可散列的类型:“列表”
如何在此处指定多个导入?
答案 0 :(得分:0)
我的坏人
from PyInstaller.utils.hooks import collect_submodules
hiddenimports_tensorflow = collect_submodules('tensorflow_core')
hidden_imports_h5py = collect_submodules('h5py')
只需要追加两个列表
all_hidden_imports = hiddenimports_tensorflow + hidden_imports_h5py
a = Analysis(['smile.py'],
pathex=['D:\\myfolder\\myfile'],
binaries=[],
datas=[],
hiddenimports=all_hidden_imports,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)