To follow the setup instructions below, you'll need to work in the Terminal app. You can open it in three different ways
- press "Command" (the ⌘ key) + "White space" (the spacebar), type "Terminal" in the search field, and hit Enter
- open the Launchpad, type "Terminal" in the search field, then click Terminal
- in the Finder, open the /Applications/Utilities folder, then double-click "Terminal.app"
see https://support.apple.com/en-gb/guide/terminal/apd5265185d-f365-44cb-8b09-71a064a42125/mac
Homebrew is a package manager for MacOS.
Please follow the instructions here: https://docs.brew.sh/Installation
Once you have installed homebrew, you can use it to install python (version 3.11):
brew install [email protected]
whereis python
python --version
Next, install minigorge, a minimal installer for Conda (see https://github.com/conda-forge/miniforge):
brew install --cask miniforge
We recommend installation and setup throgh homebrew.
But if you do not want to (or cannot) use homebrew, you can install manually install
- miniforge from https://github.com/conda-forge/miniforge#miniforge3, or
- Anaconda as described here and here
First check if your Mac uses an Apple silicon instead of an Intel processors: https://support.apple.com/
# create
conda create -y -n advanced_text_analysis_gesis python=3.11 pip
# activate
conda activate advanced_text_analysis_gesis
# verify python and pip versions and paths
python --version
which python # <== should be contain 'miniforge3/envs/advanced_text_analysis_gesis/bin'
pip --version
which pip # # <== should be contain 'miniforge3/envs/advanced_text_analysis_gesis/bin'
# create
CONDA_SUBDIR=osx-arm64 conda create -y -n advanced_text_analysis_gesis python=3.11 pip
# activate
conda activate advanced_text_analysis_gesis
# verify python and pip versions and paths
python --version
which python # <== should be contain 'miniforge3/envs/advanced_text_analysis_gesis/bin'
pip --version
which pip # # <== should be contain 'miniforge3/envs/advanced_text_analysis_gesis/bin'
# install Jupyter Notebooks
conda install -y notebook ipywidgets
# install all required packages in the correct versions
pip install -r https://raw.githubusercontent.com/haukelicht/advanced_text_analysis/main/setup/requirements.txt
Note: if your mac has an Apple silicon M1/M2/3 chip, you need to have at least macOS 12.3 (Catalina) installed
sw_vers | grep ProductVersion
If not, update your operating system.
Next, you can check that Apple silicon M1/M2/3 chip available to torch
:
python -c 'import torch.backends.mps as mps; print(mps.is_available())' # <== should be True