Notes

Making pip require a virtualenv

December 5, 2019

Using python pip to install packages without using a virtualenv is generally considered an antipattern. Add this into your ~/.bashrc to make pip require an activated virtualenv before running.

# Do not pip install when not in a virtual environment
# https://docs.python-guide.org/dev/pip-virtualenv/#requiring-an-active-virtual-environment-for-pip
export PIP_REQUIRE_VIRTUALENV=true