4 ms·
>but IIRC installing packages globally was pretty brittle. The current trick is to use pipx[0]. Pipx will create an individual virtual environment for every ex
by 41b696ef1113 5y ago
>but IIRC installing packages globally was pretty brittle.
The current trick is to use pipx[0]. Pipx will create an individual virtual environment for every executable tool you have, so there is no chance of conflicts.
You do `pipx install httpie` or `pipx install black` and then both utilities will be on your PATH, installed with whatever dependencies they require. I have never run into any issues with it.
Ninja edit: it also makes upgrades trivial: `pipx upgrade-all`
[0] https://pypa.github.io/pipx/ https://pypa.github.io/pipx/
- MereInterest 5y agoThis might be an old man yelling at clouds, but I feel like virtual environments should be used for development and testing, but not for deployment. I'm development and testing, virtual environments let you test the package against many different versions of the dependencies. Using it for deployment, though, means that after a security hotfix, the admin needs to hunt down each utility's copy of a dependency, rather than just updating the one shared copy of the dependencies.
- 41b696ef1113 5y agoWhile everything about Python packaging is still a mess (but we now have a walrus operator, win?), I view virtual environment distribution as nothing more than a clunky static vs dynamic linking situation. Trust the system or bring your own. I see the rise of Docker as indication that static linking won.
- 0x008 5y agoBut dependencies should be pinned for every application anyway to not break compatibility when sysadmin goes and updates all dependencies. There are two sides of the coin :)
- renewiltord 5y agoFor a language like Python, the pipx venv is similar to a Go static link. Same model of problem.