首页 > 解决方案 > 无法将烧瓶 tesseract 应用程序部署到 heroku

问题描述

我想将我的 tesseract 应用程序部署到 heroku,但它总是“无法找到包 tesseract-ocr”并且无法部署它。

我正在关注教程和

我的步骤:

  1. 将 pytesseract.pytesseract.tesseract_cmd = '/app/.apt/usr/bin/tesseract' 写入我的应用程序代码
  2. 获取 requirements.txt、procfile 和 Aptfile,包括 tesseract-ocr tesseract-ocr-eng
  3. 添加 Buildpack https://github.com/heroku/heroku-buildpack-apt(我直接在设置中添加),我也尝试了这个 buildpack:https ://github.com/matteotiziano/heroku-buildpack-tesseract
  4. 添加 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)
  5. 然后我再次部署它(在我添加 Buildpack 等之前我已经部署了它)

这是我得到的错误:

E: Unable to locate package tesseract-ocr
 !     Push rejected, failed to compile Apt app.
 !     Push failed

非常感谢您的帮助!

更多信息:我的应用程序在邮递员本地工作,所以我不认为这是一个编码问题。

标签: flaskherokutesseractpython-tesseract

解决方案


推荐阅读