2 ms·
Pip has that feature now. Put this in your ~/.pip/pip.conf: [global] require-virtualenv = true and then you get errors like: $ pip install foo ERROR:
by kstrauser 6y ago
Pip has that feature now. Put this in your ~/.pip/pip.conf:
[global]
require-virtualenv = true
and then you get errors like:
$ pip install foo
ERROR: Could not find an activated virtualenv (required).
- nemetroid 6y agoThat's not exactly the same. I might be fine with installing Python packages with pip into my home directory, just not /usr.
- kstrauser 6y agoMy workflow's been to temporary disable that, do the stuff I need, then re-enable it. It's a bit clunky, but I don't install stuff outside a virtualenv frequently enough for it to be a major pain in the neck.
- skrtskrt 6y agoYeah I use pyenv + virtualenvwrapper and there are a few packages I am fine with having in the top-level pyenv version, rather than in any particular virtual environment: black, requests, click, etc.