The build looks for "python" and "python-config", while modern
distributions provide only "python3" and "python3-config" by default.
Suggest installing "python-is-python3" and "python-dev-is-python3", as
available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and
later.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
tools/perf/Makefile.config | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index a6448a804ee53a36..b37149afdb1d27ba 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -872,7 +872,7 @@ ifdef NO_LIBPYTHON
else
ifndef PYTHON
- $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
+ $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev/python-dev-is-python3)
else
PYTHON_WORD := $(call shell-wordify,$(PYTHON))
@@ -915,7 +915,7 @@ endif
ifneq ($(NO_JEVENTS),1)
NO_JEVENTS := 0
ifndef PYTHON
- $(error ERROR: No python interpreter found for jevents generation. Install python or build with NO_JEVENTS=1.)
+ $(error ERROR: No python interpreter found for jevents generation. Install python/python-is-python3 or build with NO_JEVENTS=1.)
else
# jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
--
2.43.0
Hi Geert, On Thu, Oct 16, 2025 at 02:44:12PM +0200, Geert Uytterhoeven wrote: > The build looks for "python" and "python-config", while modern > distributions provide only "python3" and "python3-config" by default. > Suggest installing "python-is-python3" and "python-dev-is-python3", as > available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and > later. Seems to me, this change is not necessary. The Makefile [1] searches python[2|3]/python[2|3]-cofig if un-versioned executables are not found. I confirmed that I can build successfully without installation python-dev-is-python3 package. Thanks, Leo [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/Makefile.config?//h=v6.18-rc1#n302
Hi Leo,
On Fri, 17 Oct 2025 at 14:29, Leo Yan <leo.yan@arm.com> wrote:
> On Thu, Oct 16, 2025 at 02:44:12PM +0200, Geert Uytterhoeven wrote:
> > The build looks for "python" and "python-config", while modern
> > distributions provide only "python3" and "python3-config" by default.
> > Suggest installing "python-is-python3" and "python-dev-is-python3", as
> > available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and
> > later.
>
> Seems to me, this change is not necessary. The Makefile [1] searches
> python[2|3]/python[2|3]-cofig if un-versioned executables are not found.
>
> I confirmed that I can build successfully without installation
> python-dev-is-python3 package.
$ sudo apt remove python-dev-is-python3 python-is-python3
$ make tools/perf
Indeed, it still works. I am quite sure I had to install both, and
even verified that uninstalling them again broke the build again before
creating my patch.
/me dives deeper.
Aha, I found it. After uninstalling python3-dev, I got into the same
state as yesterday:
$ make tools/perf
[...]
Makefile.config:875: No python interpreter was found: disables
Python support - please install python-devel/python-dev
Makefile.config:918: *** ERROR: No python interpreter needed for
jevents generation. Install python or build with NO_JEVENTS=1.. Stop.
So these error messages sound like python is missing. And "python"
is indeed missing, but "python3" is available.
Hence I installed python-is-python3, but that turned out not to be
sufficient.
Hence I also installed python-dev-is-python3, and that fixed the issue,
as python-dev-is-python3 depends on python3-dev, so the latter was
installed, too.
After removing python-is-python3 and python-dev-is-python3, everything
keeps on working. But if you never installed python3-dev manually,
and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing
the issue.
So just recomming to install python-dev-is-python3 in the error
message should be sufficient?
What do you think?
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hello, On Fri, Oct 17, 2025 at 06:39:04PM +0200, Geert Uytterhoeven wrote: > Hi Leo, > > On Fri, 17 Oct 2025 at 14:29, Leo Yan <leo.yan@arm.com> wrote: > > On Thu, Oct 16, 2025 at 02:44:12PM +0200, Geert Uytterhoeven wrote: > > > The build looks for "python" and "python-config", while modern > > > distributions provide only "python3" and "python3-config" by default. > > > Suggest installing "python-is-python3" and "python-dev-is-python3", as > > > available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and > > > later. > > > > Seems to me, this change is not necessary. The Makefile [1] searches > > python[2|3]/python[2|3]-cofig if un-versioned executables are not found. > > > > I confirmed that I can build successfully without installation > > python-dev-is-python3 package. > > $ sudo apt remove python-dev-is-python3 python-is-python3 > $ make tools/perf > > Indeed, it still works. I am quite sure I had to install both, and > even verified that uninstalling them again broke the build again before > creating my patch. > > /me dives deeper. > > Aha, I found it. After uninstalling python3-dev, I got into the same > state as yesterday: > > $ make tools/perf > [...] > Makefile.config:875: No python interpreter was found: disables > Python support - please install python-devel/python-dev > Makefile.config:918: *** ERROR: No python interpreter needed for > jevents generation. Install python or build with NO_JEVENTS=1.. Stop. > > So these error messages sound like python is missing. And "python" > is indeed missing, but "python3" is available. > Hence I installed python-is-python3, but that turned out not to be > sufficient. > Hence I also installed python-dev-is-python3, and that fixed the issue, > as python-dev-is-python3 depends on python3-dev, so the latter was > installed, too. > > After removing python-is-python3 and python-dev-is-python3, everything > keeps on working. But if you never installed python3-dev manually, > and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing > the issue. > > So just recomming to install python-dev-is-python3 in the error > message should be sufficient? > > What do you think? > Thanks! Thanks for looking at the issue. I think the code was to deal with either python2 or python3 in the past and we removed python2 support recently. I don't know if any distro made 'python' to refer python3 and removed 'python3' otherwise we can just check python3. Thanks, Namhyung
On Sun, Oct 19, 2025 at 11:49:56AM +0900, Namhyung Kim wrote: [...] > > Aha, I found it. After uninstalling python3-dev, I got into the same > > state as yesterday: > > > > $ make tools/perf > > [...] > > Makefile.config:875: No python interpreter was found: disables > > Python support - please install python-devel/python-dev > > Makefile.config:918: *** ERROR: No python interpreter needed for > > jevents generation. Install python or build with NO_JEVENTS=1.. Stop. > > > > So these error messages sound like python is missing. And "python" > > is indeed missing, but "python3" is available. > > Hence I installed python-is-python3, but that turned out not to be > > sufficient. > > Hence I also installed python-dev-is-python3, and that fixed the issue, > > as python-dev-is-python3 depends on python3-dev, so the latter was > > installed, too. > > > > After removing python-is-python3 and python-dev-is-python3, everything > > keeps on working. But if you never installed python3-dev manually, > > and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing > > the issue. > > > > So just recomming to install python-dev-is-python3 in the error > > message should be sufficient? > > > > What do you think? Can we explicitly suggest that developers install python3-devel or python3-dev instead? Two reasons: - python-dev-is-python3 is specific to Ubuntu/Debian; some distros do not provide this package and even advocate against using unversioned "/usr/bin/python" shebangs [1]. - As Namhyung mentioned, perf has removed Python 2 support (at least this is claimed), it is straightforward to install only the Python3 packages. [...] > I think the code was to deal with either python2 or python3 in the past > and we removed python2 support recently. I don't know if any distro > made 'python' to refer python3 and removed 'python3' otherwise we can > just check python3. I agreed with only checking python3 - neat and compatible for distros. Just note, some legacy python shebangs are left, we can update to "#!/usr/bin/env python3" but this can be done separately. $ git grep "#\!.*/usr/bin.*python" python/tracepoint.py:#! /usr/bin/env python python/twatch.py:#! /usr/bin/env python scripts/python/export-to-postgresql.py:# #!/usr/bin/python2 scripts/python/exported-sql-viewer.py:#!/usr/bin/env python scripts/python/libxed.py:#!/usr/bin/env python tests/shell/lib/perf_json_output_lint.py:#!/usr/bin/python Thanks, Leo [1] https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package#Motivation
Hi Leo,
On Mon, 20 Oct 2025 at 11:31, Leo Yan <leo.yan@arm.com> wrote:
> On Sun, Oct 19, 2025 at 11:49:56AM +0900, Namhyung Kim wrote:
> > > Aha, I found it. After uninstalling python3-dev, I got into the same
> > > state as yesterday:
> > >
> > > $ make tools/perf
> > > [...]
> > > Makefile.config:875: No python interpreter was found: disables
> > > Python support - please install python-devel/python-dev
> > > Makefile.config:918: *** ERROR: No python interpreter needed for
> > > jevents generation. Install python or build with NO_JEVENTS=1.. Stop.
> > >
> > > So these error messages sound like python is missing. And "python"
> > > is indeed missing, but "python3" is available.
> > > Hence I installed python-is-python3, but that turned out not to be
> > > sufficient.
> > > Hence I also installed python-dev-is-python3, and that fixed the issue,
> > > as python-dev-is-python3 depends on python3-dev, so the latter was
> > > installed, too.
> > >
> > > After removing python-is-python3 and python-dev-is-python3, everything
> > > keeps on working. But if you never installed python3-dev manually,
> > > and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing
> > > the issue.
> > >
> > > So just recomming to install python-dev-is-python3 in the error
> > > message should be sufficient?
> > >
> > > What do you think?
>
> Can we explicitly suggest that developers install python3-devel or
> python3-dev instead? Two reasons:
>
> - python-dev-is-python3 is specific to Ubuntu/Debian; some distros do
> not provide this package and even advocate against using unversioned
> "/usr/bin/python" shebangs [1].
>
> - As Namhyung mentioned, perf has removed Python 2 support (at least
> this is claimed), it is straightforward to install only the Python3
> packages.
Suggesting python3-dev sounds good to me.
None of the two checks:
ifndef PYTHON
$(call disable-python,No python interpreter was found: disables
Python support - please install python-devel/python-dev)
ifndef PYTHON
$(error ERROR: No python interpreter found for jevents
generation. Install python or build with NO_JEVENTS=1.)
seem to be about the python interpreter anyway, but about the python
development environment.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hi Geert,
On Mon, Oct 20, 2025 at 12:15:22PM +0200, Geert Uytterhoeven wrote:
[...]
> > Can we explicitly suggest that developers install python3-devel or
> > python3-dev instead? Two reasons:
> >
> > - python-dev-is-python3 is specific to Ubuntu/Debian; some distros do
> > not provide this package and even advocate against using unversioned
> > "/usr/bin/python" shebangs [1].
> >
> > - As Namhyung mentioned, perf has removed Python 2 support (at least
> > this is claimed), it is straightforward to install only the Python3
> > packages.
>
> Suggesting python3-dev sounds good to me.
It is good to mention both python3-devel / python3-dev (one is for Fedora
and another is for Debian/Ubuntu). Sorry for confusion.
> None of the two checks:
>
> ifndef PYTHON
> $(call disable-python,No python interpreter was found: disables
> Python support - please install python-devel/python-dev)
>
> ifndef PYTHON
> $(error ERROR: No python interpreter found for jevents
> generation. Install python or build with NO_JEVENTS=1.)
>
> seem to be about the python interpreter anyway, but about the python
> development environment.
Either is fine for me.
Thanks,
Leo
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
© 2016 - 2026 Red Hat, Inc.