Link Search Menu Expand Document

1. INSTALL HOMEBREW, PYTHON, AND PIP ON A MAC

To do this we have to install XCode, which is the Macintosh developer tool package and Homebrew which is a common package manager that handles installation and update of mostly open source software. If you are familiar with other package managers, they will work as well.

  • Open your macOS Terminal with Spotlight by entering
    ⌘ + spacebar and typing:
    Terminal to launch the Terminal command line interface.

  • Next, install Xcode Command Line Tools, whic are required to install the Homebrew Package Manager

    xcode-select --install
    

A prompt should appear asking you to confirm the installation of Xcode (you may need to enter your password)

  • Once Xcode is installed, let’s fetch and install the Homebrew Package Manager by typing:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)
    
  • Once brew is installed, let’s install pyenv which will let us manage python and its PyPip (pip) packages to run our recognition program; it will also allow us to run different versions of the Python language if we need to::
    brew install pyenv
    
  • Now let’s install the latest Python and Pip software using pyenv:
    pyenv install 3.8.5
    
  • And let’s make this version of Python the default:
    pyenv global 3.8.5
    
    pyenv local 3.8.5
    
  • We now need to add this information to our PATH to ensure we’ll be using this version of Python in Terminal:
    Take note of which shell your OS is using by typing:
    echo "$SHELL"
    

    In most cases you’ll receive a response of either:
    /bin/zsh or /bin/bash
    This tells us what PATH file to edit to ensure everything runs smoothly.

  • If you saw:/bin/zsh
    Enter:
    echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc
    

    or

  • If you saw:/bin/bash
    Enter:
    echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
    
  • Start a New Shell by typing:
    ⌘N

Install Handprint using pip3

In macOS Terminal

pip3 install handprint

Continue to Step 2a. Set up Microsoft Azure Cloud for text recognition and extraction


Content is modified from material originally written by Michael Hucka for Handprint and made available under the terms of a CC BY-SA 4.0 license.