【发布时间】:2020-09-04 02:13:13
【问题描述】:
当尝试使用以下脚本添加大量隐藏导入时,pyinstaller 返回错误:
TypeError: unhashable type: 'list'
stuff = []
with open("warn.txt", 'r') as f:
lines = f.readlines()
for i in range(16, len(lines)):
content = (lines[i].split('-', 1))[0][21:-1]
if content != '':
if content[0] == '\'':
content = content[1:-1]
stuff.append(content)
有没有办法使用脚本而不是手动添加大量隐藏导入?
如果有任何帮助,warn.txt 文件在第 16 行之后的行看起来都像这样(并且代码在 PyCharm 中运行时会产生预期的输出,即模块名称列表):
missing module named win32api - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional)
【问题讨论】:
标签: python python-3.x build pyinstaller