Python3 binary missing when building stdlib

I cloned the modular repository at 9855690a6a40f87f7c2948a59d417dee21d966f1 and tried to build the mojo standard library with

sh bazelw build //mojo/stdlib/...

from within the repository but that fails with

Error in fail: Failed to find python3 binary
ERROR: @llvm-project//lldb:enable_libedit :: Error loading option @llvm-project//lldb:enable_libedit: Failed to find python3 binary

I am on NixOS which makes such things usually more involved than on other systems because of the missing Linux FHS directory structure but in this case it’s strange because the error also appears if I enter a pixi shell in which the python3 binary is added to the $PATH and that binary is also working if I use it directly.

Any ideas what the problem could be?

Got fixed in the modular repo by [bazel] Fix some open source build edge cases · modular/modular@524a356 · GitHub.

More background information about it in Failed to find python3 binary · Issue #550 · bazel-contrib/toolchains_llvm · GitHub.