【问题标题】:Python 3.6 no module named 'gspread' - pyinstaller compiled executablePython 3.6 没有名为“gspread”的模块 - pyinstaller 编译的可执行文件
【发布时间】: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


【解决方案1】:

没关系,这是我自己的错。我在目录本身中设置了--paths=,难怪找不到它(如上所述)

【讨论】:

    猜你喜欢
    • 2017-05-01
    • 2018-12-21
    • 2017-11-28
    • 2019-05-09
    • 2018-06-13
    • 2017-11-21
    • 1970-01-01
    • 2021-04-12
    • 2019-07-10
    相关资源
    最近更新 更多