Search code examples
pythonherokutesseract

Permission Error: [Errno 13] Permission denied: 'traccert/tesseract.exe' while run our flask application


When I run the application on local host, its working fine, but when I run the application on heroku and try to convert the image to text its show an error. You may check the image below.

This is path to tesseract: pytesseract.pytesseract.tesseract_cmd = 'traccert/tesseract.exe'

1: click here to see the image of an error.


Solution

  • It looks like you're trying to execute a .exe file, which is only runnable on the Windows operating system. Heroku's platform is Linux-based, which means you won't be able to run that .exe file.

    If you're willing to do some work, you might be able to get the .exe file running by building a custom Heroku Buildpack that includes wine, but this depends on a lot of variables: what libraries your Windows executable relies on, etc.