pyexec

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pyexec resolves the Python interpreter that runs PANDA's agent adapters (adapters/*.py).

It exists because "python3" is not a portable command name. A stock Windows install has no python3 on PATH at all: it ships the `py` launcher instead, and — worse than absent — it ships an app-execution alias called python3.exe that exists on PATH, resolves through LookPath, and does nothing but open the Microsoft Store. A node that assumed the name would advertise agent abilities, accept the delegated task, and fail at exec time, which in the flagship pipeline means the development stage is routed to the machine that cannot run it. Some Linux distributions and BSDs are the mirror image, shipping only `python`.

So the interpreter is *probed*, not named: each candidate must actually run a trivial program and print the expected answer. The result is cached for the process lifetime — the probe costs one subprocess per candidate and the interpreter does not change under a running daemon.

Index

Constants

View Source
const EnvOverride = "OPENPANDA_PYTHON"

EnvOverride names the environment variable that pins the interpreter, for hosts where the right one is neither on PATH nor named conventionally (a venv, pyenv, a Windows install under a versioned directory).

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether an adapter can be launched at all on this host.

func Command

func Command(ctx context.Context, script string, args ...string) (*exec.Cmd, bool)

Command builds a command that runs script with the resolved interpreter. The bool is false when no interpreter exists, so the caller reports that instead of exec'ing a name that is not there.

func Describe

func Describe() string

Describe renders the resolved interpreter for diagnostics (`panda doctor`), or "" when there is none.

func Interpreter

func Interpreter() []string

Interpreter returns the argv prefix that runs a Python script — {"python3"}, {"python"}, or {"py", "-3"} — or nil when this machine has no usable Python.

nil is a real answer and callers must treat it as one: a node without Python cannot run adapters, and saying so up front (see commander.Router.AgentViable) is what keeps the task on a machine that can.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL