python - Pyinstaller 没有名为 'pyfiglet.fonts ' pyinstaller ' 的模块
问题描述
嘿,我想用 Pyinstaller 导出我的 Python Selenium Projekt,但是每次当我尝试这样做时它都会出错,但是当我启动 exe 文件时,我变成了这个错误:
ModuleNotFoundError: no module named 'pyfiglet.fonts'
要启动 pyinstaller,我使用了以下命令:
pyinstaller --onefile SickoAIO.py
解决方案
没有更多信息,很难判断出什么问题。但是,我将假设您没有说明的一些事情并提供一些想法:
- 在您尝试使用 pyinstaller 之前假设 SickoAIO.py 工作正常,有时如果在您的 Python 代码中您只导入了更通用的模块:
import pyfiglet
但需要使用 pyfiglet.fonts,让它在 pyinstaller 中工作的“hack”可能是使导入更具体:
import pyfiglet.fonts
我没有使用过 pyfiglet,但是这个 hack 对我有用 numpy 模块,例如。
帮助我解决与 numpy、scipy 等类似问题的另一件事是更新模块和/或 pyinstaller 的版本
您可能需要使用钩子,尤其是因为 pyfiglet 似乎无法与 pyinstaller 配合使用。这在此处专门针对 pyfiglet 进行了解释: https ://hugomartins.io/essays/2019/06/pyinstaller-pyfiglet-trouble/ 我没有尝试过,看起来您可能需要单击该网页中的更多链接以及了解更多关于钩子如何在 pyinstaller ( https://pyinstaller.readthedocs.io/en/stable/hooks.html?highlight=hook ) 中工作以了解完整问题。
推荐阅读
- angular - CORS,从 Angular 应用程序到本地 pc 上的 asp.net 核心 API 的帖子
- akka-http - 如何通过 Akka HTTP (Java) 与 Akka Actor 交互
- swift - Swift - 每秒一定数量的 URL 请求,没有计时器
- rest - 如果 Web 服务位置不断变化,可以使用哪种架构
- r - 如何将 dplyr 函数应用于列表列?
- html-email - 如何在我的 gmail 电子邮件布局中加载网络字体
- node.js - firebase 云功能发布请求正文
- javascript - 使 NbAlertComponent 的关闭按钮起作用的正确方法是什么(关闭警报)
- python - 两个相互引用的类
- vue.js - Nuxt.js 路由限制了可能的参数选项