Configuration to enforce python virtual environment's

April 19, 2022

  • link - useful config for pip and venv
  • link - interesting to see how refactoring's are done at a large scale

In order to make sure that you install packages to your active virtual environment when you use pip install (and not globally), add the following to your .bashrc file or your pip.ini file:

# ~/.bashrc
export PIP_REQUIRE_VIRTUALENV=true
# ~/pip/pip.ini
[global]
require-virtualenv = true