/** * Returns the path to a venv binary (`python` or `pip`) for the given data * directory, cross-platform: * Windows (win32) → /searxng/venv/Scripts/.exe * POSIX → /searxng/venv/bin/ * * Pass `platform` explicitly in tests to avoid depending on the host OS. */ export declare function venvBinPath(dataDir: string, name: 'python' | 'pip', platform?: string): string; /** * Returns the first Python interpreter found on PATH: tries `python3` then * `python`. Falls back to the string `'python3'` when neither is detected so * that callers surface a clear "not found" error at execution time rather than * silently passing an empty string. * * Reuses `binaryInPath()` which already handles `which` vs `where` (Windows). * Result is memoized — the interpreter set does not change within a process, * so warm-path callers avoid repeated `which`/`where` subprocess spawns. */ export declare function resolvePythonExe(): string; /** Test-only: clear the memoized interpreter so platform-mocked tests re-resolve. */ export declare function __resetResolvedPythonExe(): void; export interface VenvModuleCheck { /** True when `python -m venv` can actually create environments. */ available: boolean; /** Detected `.` Python version, when probeable (e.g. `3.12`). */ pythonVersion?: string; } /** * Probes whether the Python interpreter can create virtual environments. * * On Debian/Ubuntu the `python3-venv` system package is not installed by * default, so `python3 -m venv ` exits 1 with a cryptic `ensurepip` / * `No module named venv` error. We probe cheaply with `python -m venv --help` * (which loads both `venv` and, on stdlib paths, surfaces the missing-ensurepip * symptom) so callers can emit actionable guidance *before* a real venv * creation fails opaquely. * * The Python version is parsed in the same pass so callers can suggest the * exact package name (`python3.12-venv` for Python 3.12). */ export declare function checkVenvModule(pythonExe?: string): VenvModuleCheck; /** * Returns true when the given stderr is the recognizable "python3-venv package * missing" symptom rather than some other venv-creation failure. Detection- * driven so callers only show apt guidance when it actually applies. */ export declare function isMissingVenvModuleError(stderr: string): boolean; /** * Builds an actionable, OS-specific install hint for the missing venv module. * Names the exact `python3.X-venv` package when the version is known, with the * generic `python3-venv` as a fallback. Naming the apt package here is * intentional troubleshooting guidance (the documented warmup/doctor * exception), not implementation-dep leakage. */ export declare function venvInstallHint(pythonVersion?: string): string; /** * Returns the Python binary to use for every Python operation — pip installs, * import availability checks, and long-lived subprocess spawns. Prefers the * SearXNG venv python (created by bootstrap) to guarantee that warmup, doctor, * and runtime all hit the same interpreter and see the same packages. * Falls back to system `python3` when the venv has not been created yet. */ export declare function getPythonBin(dataDir?: string): string; //# sourceMappingURL=python-env.d.ts.map