In modern days a plain pip install … warns to not to mess around with the
System Installation. Recommendation is either use some virtual environment,
or directly mention pipx (which is isolated venvs in the user folder).
Installation depends on the OS, use homebrew, pkg or whatever and follow displayed hints for your shell.
Things are straight forward for simple tools:
pipx install black
This creates some venv called “black” to install black in there:
which black
/Users/user/.local/bin/black
ls -la $(which black)
lrwxr-xr-x@ … /Users/user/.local/bin/black -> /Users/user/.local/pipx/venvs/black/bin/black
Nice, thanks!
But I fall in the same trap again and again:
pipx install bpython
installing bpython...
…
bpython
>>> import yaml
Traceback (most recent call last):
File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'yaml'
Note to self: You are looking for inject:
pipx inject bpython pyyaml
So long!