Reputation: 11
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:
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.
Upvotes: 1
Views: 403
Reputation: 21
Like you, I spent many hours over the last three days scouring the internet for clues to this mystifying puzzle. It was discovered that the problem was due to a bug with Heroku's buildpack relating to different newlines used by different operating systems - Windows uses CRLF while Linux uses LF (I am on Windows using WSL, I assume this issue also applies to you on Windows). Whenever I used a single package, the build would work, but whenever I added additional packages Heroku would tell me it was unable to locate them. If you are on Windows, you would need a way to ensure you have the correct newline character to prevent this from happening (I used vim in WSL).
For anyone using WSL as I am, there is yet another issue where git will convert any newline characters to CRLF, so even though I edited using an LF newline, I ended up with the same error that Heroku could not locate the desired package. As suggested, use git config --global core.autocrlf false
to disable this, then ensure your file uses only LF newlines, then push.
I was mindblown that these issues have persisted for this long and I was not able to find a single thread detailing this fix, but hopefully this works for you.
Upvotes: 1