Notes
2026-04-26
A Declarative, XDG-Compliant, “Headless-Ready” Analytics Station
If you've recently tried to pip install something globally on a
modern Linux distro, you’ve hit the PEP 668 wall: "externally
managed environment." The days of polluting system Python are over.
.venv. Suddenly, you have 15 copies of Pandas and NumPy
eating gigabytes of disk space.~) looks like a junk drawer of
.venv, .ipynb_checkpoints, and .local folders.I solve this by combining the XDG Base Directory Spec (keep it clean) with uv (keep it fast).
~/.local/share/venvs, keeping your home directory pristine.pip and venv with a single binary that is
10x-100x faster and uses a global cache to save disk space.Instead of an inflexible virtual environment, I create a declarative project inside your XDG data folder.
# 1. Create the XDG-compliant parent directory
mkdir -p ~/.local/share/venvs
cd ~/.local/share/venvs
# 2. Initialize the 'eda' project
uv init eda
cd eda
# 3. Add your EDA heavy-hitters
# This creates a pyproject.toml and a lockfile automatically
uv add jupyterlab pandas numpy matplotlib seaborn
Now, your environment isn't just a folder of binaries -- it's a defined spec that can be recreated anywhere.
To avoid navigating to this hidden directory every time, I create a
“sticky slip” in your shell configuration (~/.zshrc or ~/.bashrc).
Add this line to the bottom:
# EDA Environment: Portable & Headless-ready
alias eda-lab='uv --project ~/.local/share/venvs/eda run jupyter-lab --no-browser'