Daniel Roy Greenfeld

Daniel Roy Greenfeld

About | Articles | Books | Jobs | News | Tags

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
ā† Back to home