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但我仍然遇到同样的错误:(
解决方案
推荐阅读
- c# - 通过从 resx 文件中翻译的字符串获取名称
- amazon-web-services - AWS 负载均衡器 - 所有 EC2 实例均未通过运行状况检查并显示已停止服务。为什么?
- r - 选择下拉元素会导致错误:“元素当前不可见,可能无法操作”
- google-bigquery - BigQuery 加入需要大量时间
- javascript - 单击按钮时无法在laravel ajax中下载文件
- c# - C# 使用 JsonConverter 将 Json List 转换为 List 对象
- ajax - 出现的原因是什么 - 对象 url 未定义?
- ssl - HEROKU 免费层 SSL:您需要在 Hobby 或 Professional dynos 上运行才能使用 SNI SSL
- node.js - NodeJS 通用池如何设置请求超时?
- python - 如何使用 gurobipy 编写最大化约束