Pyinstaller可执行文件找不到包含的发行版

时间:2020-10-09 20:17:53

标签: python pyinstaller

这是我的系统信息:

35 INFO: PyInstaller: 3.6
36 INFO: Python: 3.7.2
41 INFO: Platform: Darwin-19.6.0-x86_64-i386-64bit

我一直在尝试使用Pyinstaller生成Python(Flask)可执行文件以在应用程序中使用。但是,当我打包可执行文件并运行它时,它将抛出以下内容:

pkg_resources.DistributionNotFound: The 'pyonfleet' distribution was not found and is required by the application

该依赖关系已存在于我的虚拟环境中,从Pyinstaller的调试导入日志中,我可以看到以下几行:

import onfleet # PyInstaller PYZ
import onfleet.onfleet # PyInstaller PYZ
import 'onfleet.request' # <pyimod03_importers.FrozenImporter object at 0x7fbda00ab5f8>
import 'onfleet.endpoint' # <pyimod03_importers.FrozenImporter object at 0x7fbda00ab5f8>
import onfleet.config # PyInstaller PYZ
import 'onfleet.config' # <pyimod03_importers.FrozenImporter object at 0x7fbda00ab5f8>
import 'onfleet.onfleet' # <pyimod03_importers.FrozenImporter object at 0x7fbda00ab5f8>
import 'onfleet' # <pyimod03_importers.FrozenImporter object at 0x7fbda00ab5f8>

我尝试按照此处的建议添加一个钩子:https://github.com/pyinstaller/pyinstaller/issues/4833,但仍然出现相同的错误:(

0 个答案:

没有答案