Skip to content

Instantly share code, notes, and snippets.

@fractaledmind
Last active July 9, 2019 04:52
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save fractaledmind/cd2fc4125bef57bcb3e2 to your computer and use it in GitHub Desktop.
Save fractaledmind/cd2fc4125bef57bcb3e2 to your computer and use it in GitHub Desktop.
install tesseract-ocr on a Mac
#!/usr/bin/env bash
# courtesy of : <https://ryanfb.github.io/etc/2014/11/13/command_line_ocr_on_mac_os_x.html>
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Ensure `homebrew` is up-to-date and ready
echo "Updating homebrew..."
brew doctor
# Ensure the Homebrew cache directory exists
mkdir ~/Library/Caches/Homebrew
# Install leptonica with TIFF support (and every other format, just in case)
echo "Installing leptonica..."
brew install --with-libtiff --with-openjpeg --with-giflib leptonica
# Install Ghostscript
echo "Installing ghostscript..."
brew install gs
# Install ImageMagick with TIFF and Ghostscript support
echo "Installing imagemagick..."
brew install --with-libtiff --with-ghostscript imagemagick
# Install Tesseract devel with all languages
echo "Installing tesseract..."
brew install --devel --all-languages tesseract
@hojabbr
Copy link

hojabbr commented Apr 9, 2019

Error: invalid option: --all-languages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment