Tesseract.exe path on Ubuntu

0

I want to use pytesseract on Ubuntu computer with Python. On Windows computer I had to set path to tesseract.exe before I call image to string function. How can I set this path on ubuntu computer?I cannot find path to tesseract.exe on my computer. Same question for the variable tesseract-PREFIX for data. Thanks in advance. Marek

Marek Marekovic

Posted 2019-10-26T05:43:36.260

Reputation: 1

Answers

1

To set a directory as part of the path in Ubuntu, you would need to edit the $PATH environment variable in bash. You can do this in two ways: one is permanent, one is for the duration of a bash session.

The temporary way: set it using the export command. You can do this by running this command in your session:

export PATH=$PATH:{directory of tesseract binary}

(Without the curly brackets, of course)

The permanent way: adding it to your .bashrc file. You can do this by running nano .bashrc and adding the command from above to the bottom of the text file. Then, start a new session, and every time your tesseract program's directory will be in the path.

Varun Narravula

Posted 2019-10-26T05:43:36.260

Reputation: 396

Thanks, but I can‘t find tesseract.exe on Ubuntu system. On Windows I found tesseract.exe and I set the Path. – Marek Marekovic – 2019-10-26T06:26:03.090

Ubuntu does not run .exe files, it just runs binaries if they are marked as executable in their permissions. Try using the command find tesseract or find pytesseract and it will give you a directory where your binary is. – Varun Narravula – 2019-10-26T06:29:42.507