I wanted to deploy my tesseract app to heroku but it is always 'unable to locate package tesseract-ocr' and is unable to deploy it.
I was following this tutorial and this
My steps:
- Write pytesseract.pytesseract.tesseract_cmd = ‘/app/.apt/usr/bin/tesseract’ to my app-code
- Get requirements.txt, procfile and Aptfile including tesseract-ocr tesseract-ocr-eng
- Add Buildpack https://github.com/heroku/heroku-buildpack-apt (I added it directly at settings), I also tried this buildpack: https://github.com/matteotiziano/heroku-buildpack-tesseract
- Add Tesseract config file: TESSDATA_PREFIX = ./.apt/usr/share/tesseract-ocr/4.00/tessdata (here should be the correct path of tesseract but the 'find -iname tessdata' does not work for me. I'm using the run console directly on the heroku website and I tried it also on my computer with heroku run bash -a myappname and there were also nothing displayed.) I added 'TESSDATA_PREFIX' under 'Key' and './.apt/usr/share/tesseract-ocr/4.00/tessdata' under 'Value'. Additionally tried it with: /app/.apt/usr/share/tesseract-ocr/4.00/tessdata and /app/.apt/usr/share/tesseract-ocr/tessdata)
- Then I'm deploying it again (I have it already deployed before I'm adding the Buildpack etc.)
This is the Error I get:
E: Unable to locate package tesseract-ocr
! Push rejected, failed to compile Apt app.
! Push failed
Thank you very much for your help!
Further information: my app does work locally on postman, so I don't think it's a coding issue.