TIL: Forcing pip to use virtualenv
Necessary because installing things into your base python causes false positives, true negatives, and other head bangers.
Set this environment variable, preferably in your rc file:
# ~/.zshrc
export PIP_REQUIRE_VIRTUALENV=true
Now if I try to use pip outside a virtualenv:
dj-notebook on ī main [$] is š¦ v0.6.1 via š v3.10.6
āÆ pip install ruff
ERROR: Could not find an activated virtualenv (required).
This TIL is thanks to David Winterbottom.
Tags: howto python TIL