xtekky/gpt4free · error

no python executable found (runtime not downloaded?)

Error message

no python executable found (runtime not downloaded?)

What it means

Error "no python executable found (runtime not downloaded?)" thrown in xtekky/gpt4free.

Source

Thrown at g4f-go/process.go:151

// is the *shell wrapper* (never a real interpreter), so it is not a valid
// fallback here.
func pythonExecutable(binDir string) (string, error) {
	if exe, err := androidPythonExecutable(binDir); exe != "" || err != nil {
		return exe, err
	}
	home := filepath.Join(binDir, "python-home")
	var candidates []string
	if runtime.GOOS == "windows" {
		candidates = []string{filepath.Join(home, "python.exe")}
	} else {
		candidates = []string{filepath.Join(home, "bin", "python")}
	}
	for _, exe := range candidates {
		if fi, err := os.Stat(exe); err == nil && !fi.IsDir() {
			return exe, nil
		}
	}
	return "", fmt.Errorf("no python executable found (runtime not downloaded?)")
}

// pythonHome returns the downloaded interpreter root.
func pythonHome(binDir string) string {
	if h := androidPythonHome(binDir); h != "" {
		return h
	}
	return filepath.Join(binDir, "python-home")
}

// writeLauncher installs the unix shell wrapper after the runtime is ready.
func writeLauncher(binDir string) error {
	if runtime.GOOS == "windows" {
		return nil
	}
	path := filepath.Join(binDir, "python")
	if err := os.WriteFile(path, []byte(pythonLauncher), 0o755); err != nil {
		return err

View on GitHub (pinned to 973504e177)

Solutions

  1. Run the runtime download first so the python executable exists.
  2. Re-run g4f-go to fetch and extract the embedded python runtime.

When it happens

Trigger: Thrown at g4f-go/process.go:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/9581ce14f4073930. Report an issue: GitHub.