如何解析ModuleNotFoundError:没有名为'srsly.msgpack.util'在PyInstaller中?

2024-05-13 02:12:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用PyInstaller将python脚本转换为.exe。 脚本被转换为exe,没有任何错误日志。在

但是,在运行.exe文件时,am getModuleNotFoundError:没有名为'srsly.msgpack.util'

打开PyInstaller和cx_Freeze生成的exe文件时出现此问题。 The Screenshot of the error is attached here.

已尝试更新、卸载和重新安装程序包,但问题仍然存在。在

版本:

  • Python:3.7
  • 操作系统:Windows 10
  • cx冻结:6.0
  • 消息包:0.6.2
  • PyInstaller:3.5版
  • srsly:0.1.0

Tags: 文件ofthe脚本错误utilmsgpackam
2条回答

当PyInstaller评估脚本时,它没有预测srsly.msgpack.util. 您可以使用 hiddenimport手动指定依赖项。在

    pyinstaller  hiddenimport srsly.msgpack.util your_script.py

你可能会发现解决这个问题只会暴露另一个问题。您可以根据需要添加任意数量的 hiddenimport提示。在

这里提到的问题是:https://pypi.python.org/pypi/msgpack/0.5.1

从msgpack-0.4或更早版本升级时,不要执行pip install-U msgpack python。执行pip卸载msgpack python;pip安装msgpack。在

相关问题 更多 >