Thanks fungi - is this mimicking what pipx does?
Maybe. I’d never heard of pipx until you mentioned it, but then you
get the side task of installing pipx somewhere/somehow too.
So let me see if I understand this. The first line creates a
/usr/local/lib/cowsay. For example, if I su’d to root,
/usr/local/lib/cowsay/bin/activate, then …
Presumably within this venv, I could update/install various
packages?.. So to our point, we install cowsay. So could I do it
like I’m suggesting? That is,
activate then (while still logged
in as root) run
pip install cowsay?
You could, but you don’t have to activate a venv to execute things
from it, everything in there will already know the venv context even
if you invoke them directly from your shell.
Then we simply link to the cowsay command-line script from the
global path /usr/local/bin.
Sounds reasonable! I’ll try it.
Is this how sys-admins actually do this kind of thing on
I’m a sysadmin, and I sometimes do this, yes. Most of the time,
however, I try to stick to whatever’s supplied by the distribution
I’m running (so for your exact example on my Debian servers, I’d
sudo apt install cowsay because getting a different version
from PyPI is unlikely to be particularly important). As part of your
premise, I gathered you specifically wanted to install packages from