flask - 无法将烧瓶 tesseract 应用程序部署到 heroku
问题描述
我想将我的 tesseract 应用程序部署到 heroku,但它总是“无法找到包 tesseract-ocr”并且无法部署它。
我的步骤:
- 将 pytesseract.pytesseract.tesseract_cmd = '/app/.apt/usr/bin/tesseract' 写入我的应用程序代码
- 获取 requirements.txt、procfile 和 Aptfile,包括 tesseract-ocr tesseract-ocr-eng
- 添加 Buildpack https://github.com/heroku/heroku-buildpack-apt(我直接在设置中添加),我也尝试了这个 buildpack:https ://github.com/matteotiziano/heroku-buildpack-tesseract
- 添加 Tesseract 配置文件:TESSDATA_PREFIX = ./.apt/usr/share/tesseract-ocr/4.00/tessdata (这里应该是 tesseract 的正确路径,但'find -iname tessdata'对我不起作用。我正在使用直接在heroku网站上运行控制台,我也在我的电脑上用heroku run bash -a myappname尝试过,也没有显示任何内容。)我在'Key'和'./.apt/usr/share下添加了'TESSDATA_PREFIX' /tesseract-ocr/4.00/tessdata' 在“值”下。另外尝试了:/app/.apt/usr/share/tesseract-ocr/4.00/tessdata 和 /app/.apt/usr/share/tesseract-ocr/tessdata)
- 然后我再次部署它(在我添加 Buildpack 等之前我已经部署了它)
这是我得到的错误:
E: Unable to locate package tesseract-ocr
! Push rejected, failed to compile Apt app.
! Push failed
非常感谢您的帮助!
更多信息:我的应用程序在邮递员本地工作,所以我不认为这是一个编码问题。
解决方案
推荐阅读
- tarantool - 如何查看/检查 vshards 之间的数据分布
- sql-server - 分组平均值
- python - 电子邮件字段中的 django UniqueConstraint 错误(sendgrid 验证电子邮件)
- spring-boot - Spring Boot Sleuth - TraceI vs TraceIdString
- prolog - Prolog 说明列表中的某些内容(在本例中为 grid/1)是否为白色。序言
- excel - Excel - 如何找到具有值的最后一列并拉出相应的列标题?
- c++ - clang-tidy bugprone-unused-return-value:如何检查所有功能?
- remedy - 查询 BMC Helix Remedy 数据库而不是 Smart Reporting 的有效方法
- python - JSON重命名嵌套字典名称
- jenkins - 如何为 npm 添加 Jenkins 管道“Build No”以及 package.json 中提到的版本?