tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Herbert <marc.herbert@linux.intel.com>
To: tools@kernel.org
Subject: Switch b4/README.txt to "pipx install" instead of "pip install"?
Date: Wed, 05 Nov 2025 16:20:11 -0800	[thread overview]
Message-ID: <m2wm44ui4k.fsf@C02X38VBJHD2mac.jf.intel.com> (raw)


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.


             reply	other threads:[~2025-11-06  0:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  0:20 Marc Herbert [this message]
2025-11-18 23:02 ` Switch b4/README.txt to "pipx install" instead of "pip install"? Konstantin Ryabitsev
2025-11-21 21:03   ` Marc Herbert
2025-11-21 21:23     ` Konstantin Ryabitsev
2025-11-21 22:33       ` Marc Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wm44ui4k.fsf@C02X38VBJHD2mac.jf.intel.com \
    --to=marc.herbert@linux.intel.com \
    --cc=tools@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).