• conda create --name tess-build 
    conda activate tess-build
    
  • Install the following dependencies. You’ll need at least leptonica 1.74 for this to work - I’m using 1.78.0.

  • conda install -c conda-forge automake
    conda install -c conda-forge libtool
    conda install -c conda-forge pkgconfig
    conda install -c conda-forge leptonica
    
  • Clone the latest Tesseract version from the master branch and navigate into the directory:

  • git clone https://github.com/tesseract-ocr/tesseract.git
    cd tesseract
    
  • Run the following scripts to prepare the building process

  • ./autogen.sh
    ./configure
    
  • Conda might not include the path to its libraries inside the LD_LIBRARY_PATH environment variable. I had to include it manually otherwise the build fails during linking:

  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.conda/envs/tess-build/lib
    
  • Run the makefile:

  • make
    
  • Set the TESSDATA_PREFIX environment variable in order to inform Tesseract where to look for language packs; also download the eng (default) language pack into tessdata

  • export TESSDATA_PREFIX=$HOME/tesseract/tessdata
    wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata -P tessdata/
    
  • See if it works: