【问题标题】:ModuleNotFoundError For PyinstallerPyinstaller 的 ModuleNotFoundError
【发布时间】:2018-09-06 15:57:10
【问题描述】:

我写了一个带有PyQt5+Python3.6接口的工具,我想打包成一个.exe文件在没有Python环境的机器上运行。根据网上使用pyinstaller打包,打包结束后dist文件夹中的exe文件打开后报错:

ModuleNotFoundError: 没有名为“scipy._lib.messagestream”的模块

这个问题是在.spec文件的hiddenimports解决后修改的:

hiddenimports=['scipy._lib.messagestream']

然后是命令生成的新的.exe文件:

pyinstaller x.spec

还是报错。

ModuleNotFoundError: 没有名为“typedefs”的模块

然后,继续添加……继续报错,这一切都报错……

你如何解决这个问题?

【问题讨论】:

标签: python pyinstaller


【解决方案1】:

您是否在虚拟环境 (venv) 中工作? 如果是这样,您应该添加站点包路径:

pyinstaller --paths path\to\venv\Lib\site-packages script.py

在我使用 --paths 运行 pyinstaller 之前,selenium 模块发生在我身上

【讨论】:

    猜你喜欢
    • 2020-06-08
    • 1970-01-01
    • 2021-03-30
    • 2020-01-31
    • 2021-03-26
    • 1970-01-01
    • 1970-01-01
    • 2020-06-03
    • 1970-01-01
    相关资源
    最近更新 更多