Tom Primožič

programming & computer tips

new Mac setup

Python setup

use mambaforge instead of conda for Python development (it's way faster)

curl --ssl-reqd -sLo mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash mambaforge.sh -b -p "$(pwd)/lib/mambaforge" && rm mambaforge.sh
lib/mambaforge/bin/mamba init $(basename $SHELL) && lib/mambaforge/bin/conda config --set auto_activate_base false && exec $SHELL --login

create a new env called dev NOTE: don’t install packages into the base environment because it cannot be deleted if you mess up

mamba create -n dev && mamba activate dev
mamba install --yes -c pytorch -c nvidia -c conda-forge -c defaults \
  pandas numpyro jupyterlab tqdm matplotlib numba pyarrow \
  ipywidgets boto3 lxml beautifulsoup4 flask scikit-learn scipy \
  sympy dash psycopg2 sqlalchemy bokeh seaborn statsmodels altair \
  xarray arviz corner einops requests pytorch torchvision \
  torchaudio torchtext torchdata spacy ipympl \
  pytorch-cuda=12.1         # optional, only of you want CUDA / GPU support in PyTorch
jupyter labextension disable '@jupyterlab/apputils-extension:announcements'    # disable spam

Python debugging

import code; code.interact(local=locals())

Thanks Andrej Karpathy!

Linux cheatsheet