Install UBA on macOS Big Sur - eliranwong/UniqueBible GitHub Wiki

Install UBA on macOS Big Sur

In view of a known issue of python with macOS Big Sur (https://github.com/eliranwong/UniqueBible/issues/141), we offer instructions below on installing UBA on macOS Big Sur.

A Tested Example

Run the following steps with macOS terminal app. (please note that some steps below may be optional, but it works on my side.)

  1. Install Xcode Command Line Tools

xcode-select --install

  1. Install homebrew (https://brew.sh)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  1. Install the python build dependencies and a few other elements (https://github.com/pyenv/pyenv/wiki#suggested-build-environment):

brew install openssl readline sqlite3 xz zlib bzip2 git

  1. Add bzip2 path

(One may use the following line to check which shell is being used. recent macOS versions use zsh by default, older versions use bash by default):

echo $SHELL

(For bash users)

echo 'export PATH="/usr/local/opt/bzip2/bin:$PATH"' >> ~/.bash_profile echo 'export LDFLAGS="-L/usr/local/opt/bzip2/lib"' >> ~/.bash_profile echo 'export CPPFLAGS="-I/usr/local/opt/bzip2/include"' >> ~/.bash_profile

(For zsh users)

echo 'export PATH="/usr/local/opt/bzip2/bin:$PATH"' >> ~/.zshrc echo 'export LDFLAGS="-L/usr/local/opt/bzip2/lib"' >> ~/.zshrc echo 'export CPPFLAGS="-I/usr/local/opt/bzip2/include"' >> ~/.zshrc

  1. Install pyenv (https://github.com/pyenv/pyenv):

brew install pyenv

  1. Add pyenv path

(for bash user, run)

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

or

(for zsh user, run)

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc

  1. Restart terminal app (or you may simply open a new tab)

  2. Install python 3.7.3 (you may choose other version from version 3.7 or above; read more at: https://github.com/pyenv/pyenv/issues/1643#issuecomment-684050015)

CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(xcrun --show-sdk-path)/usr/lib"
pyenv install --patch 3.7.3 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch)

  1. Set pyenv global to 3.7.3 (you may want to set a particular python version only for UBA, rather than global. read more at: https://github.com/pyenv/pyenv):

pyenv global 3.7.3

  1. Download UBA with git

git clone https://github.com/eliranwong/UniqueBible

  1. Run UBA:

python3 UniqueBible/uba.py