xtekky/gpt4free · error

Termux is required to build the python runner (install com.t

Error message

Termux is required to build the python runner (install com.termux and retry)

What it means

Error "Termux is required to build the python runner (install com.termux and retry)" thrown in xtekky/gpt4free.

Source

Thrown at g4f-go/runtime_android.go:90

	}
	if fi, err := os.Stat(androidPythonHome(binDir)); err == nil && fi.IsDir() {
		// runtime present but runner not built yet
		return "", fmt.Errorf("android runtime present but runner missing; rerun g4f-go to build it")
	}
	return "", nil
}

// androidPythonExe returns the interpreter path for the android layout
// (the dlopen target inside the runner).
func androidPythonExe(binDir string) string {
	return filepath.Join(androidPythonHome(binDir), "lib", "libpython3.14.so")
}

// buildAndroidRunner compiles pyandroid_runner.c against the downloaded
// python headers using Termux's clang, then links against libpython.
func buildAndroidRunner(binDir string) error {
	if ok, err := IsTermuxInstalled(); err != nil || !ok {
		return fmt.Errorf("Termux is required to build the python runner (install com.termux and retry)")
	}
	home := androidPythonHome(binDir)
	lib := filepath.Join(home, "lib")
	include := filepath.Join(home, "include", "python3.14")
	src := filepath.Join(binDir, "pyandroid_runner.c")
	if _, err := os.Stat(src); err != nil {
		return fmt.Errorf("pyandroid_runner.c missing: %w", err)
	}

	// Termux clang is at $PREFIX/bin/clang; $PREFIX is /data/data/com.termux/files/usr.
	termuxPrefix := "/data/data/com.termux/files/usr"
	cc := filepath.Join(termuxPrefix, "bin", "clang")
	if _, err := os.Stat(cc); err != nil {
		// fall back to whatever clang is on PATH
		cc = "clang"
	}
	out := filepath.Join(binDir, "pyandroid")
	args := []string{

View on GitHub (pinned to 973504e177)

Solutions

  1. Install the Termux app (com.termux) and retry.

When it happens

Trigger: Thrown at g4f-go/runtime_android.go:90 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/7a27bfbfbcb5cec5. Report an issue: GitHub.