【发布时间】:2017-06-06 14:48:41
【问题描述】:
我已经使用 pyinstaller 编译了一些 python 代码,运行良好,但是在运行实际的可执行文件时,我得到了标题中提到的错误。
我试图解决这个问题:
--paths=directoryofgspreadmodule
# still got the same error.
--hidden-import=gspread
# Samething
总体命令:
python pyinstaller.py -F MyCode.py --paths=directoryofgspreadmodule --onefile
顺便说一句,我也在使用 matplotlib,可执行文件似乎有 200Mb,这正常吗?
感谢您的帮助
【问题讨论】:
-
检查 gspread 模块是否被打包但放置在错误的位置。我的应用程序中的 dll 有这个问题。您可以尝试将 --debug 添加到命令中以获取其他输出信息...您也可以尝试查看 %TEMP%\MEI... 解压缩可执行文件的目录。如果它不存在,那么您至少缩小了范围
-
我在 %TEMP%\MEI 中找不到它,但是在查看“warnMain”(称为我的 python 代码“main”)时,我发现:缺少名为 gspread 的模块 - 由 Main 导入
标签: python pyinstaller