tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* Switch b4/README.txt to "pipx install" instead of "pip install"?
@ 2025-11-06  0:20 Marc Herbert
  2025-11-18 23:02 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Herbert @ 2025-11-06  0:20 UTC (permalink / raw)
  To: tools


Following the current b4/README.txt instructions on any recent Linux
distribution (approx. less than 2 years old) fails instantly with the
well-known "externally managed" error https://peps.python.org/pep-0668/


$ python3 -m pip install b4
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian/Arch/etc.-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
==> it may be easiest to use pipx install xyz, which will manage a    <===== pipx =====
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.


I've been using pipx for months and it Just Works. As stated, it
automates creating, entering and leaving the virtualenv.

I just tested Ubuntu 22.04. It's old enough not to fail like this
(preferring to... actually and silently "break system packages" instead)
but pipx also works just fine on it.

So, should the README simply switch to "pipx install"?

References:
- https://lwn.net/Articles/959236/
- https://repology.org/project/pipx/versions
- https://peps.python.org/pep-0668/

  ------


Also, I'm not an expert but I think installing from source is probably
better done like this:

git clone --recursive b4
cd b4
pipx install -e .

This allows running any version _and_ from the checkout directory
without depending on any "b4.sh" indirection.  The main difference is:
dependencies are isolated/protected in the virtualenv. Some users may
want this, others not.

Anyway that's another debate further down the line.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-21 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06  0:20 Switch b4/README.txt to "pipx install" instead of "pip install"? Marc Herbert
2025-11-18 23:02 ` Konstantin Ryabitsev
2025-11-21 21:03   ` Marc Herbert
2025-11-21 21:23     ` Konstantin Ryabitsev
2025-11-21 22:33       ` Marc Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).