apache/seatunnel · error · IOException

Unable to resolve python.executable from PATH: {}

Error message

Unable to resolve python.executable from PATH: {}

What it means

Thrown by PythonSourceExecutionPolicy.resolveConfiguredExecutable when the configured python.executable is neither an absolute path nor a bare command name that can be found on PATH — specifically a bare name (no parent directory) that PATH lookup failed to resolve to a location. The policy cannot determine which interpreter to launch.

Source

Thrown at seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceExecutionPolicy.java:112

        if (allowedExecutables.isEmpty()) {
            throw new IllegalStateException(
                    "Server property "
                            + PYTHON_ALLOWED_EXECUTABLES_PROPERTY
                            + " does not contain a usable absolute path");
        }
        return new ArrayList<>(allowedExecutables);
    }

    private static Path resolveConfiguredExecutable(String configuredExecutable)
            throws IOException {
        Path configuredPath = Paths.get(configuredExecutable);
        Path resolvedPath;
        if (configuredPath.isAbsolute()) {
            resolvedPath = normalize(configuredPath);
        } else if (configuredPath.getParent() == null) {
            resolvedPath = resolveCommandFromPath(configuredExecutable);
            if (resolvedPath == null) {
                throw new IOException(
                        "Unable to resolve python.executable from PATH: " + configuredExecutable);
            }
        } else {
            throw new IllegalStateException(
                    "python.executable must be an absolute path or a bare command name: "
                            + configuredExecutable);
        }
        if (!Files.isRegularFile(resolvedPath) || !Files.isExecutable(resolvedPath)) {
            throw new IOException(
                    "python.executable does not resolve to an executable file: " + resolvedPath);
        }
        return resolvedPath;
    }

    private static Path resolveCommandFromPath(String command) {
        String pathValue = System.getenv("PATH");
        if (pathValue == null || pathValue.trim().isEmpty()) {
            return null;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use the absolute interpreter path instead of a bare command, e.g. /usr/bin/python3.11
  2. Ensure the interpreter is on PATH of the user running SeaTunnel (check echo $PATH inside that environment)
  3. Make sure the name is also present in the python.allowed.executables allowlist

Example fix

// before
pythonExecutable = "python3.11"
// after
pythonExecutable = "/usr/local/bin/python3.11"
Defensive patterns

Strategy: validation

Validate before calling

String exe = config.getPythonExecutable();
if (exe.contains("/")) {
    if (!Paths.get(exe).isAbsolute()) throw new IllegalArgumentException("Use absolute path: " + exe);
} else if (Arrays.stream(System.getenv("PATH").split(":")).noneMatch(d -> new File(d, exe).canExecute())) {
    throw new IllegalArgumentException("Not on PATH: " + exe);
}

Prevention

When it happens

Trigger: Setting sourceConfig pythonExecutable to a bare name like 'python3.11' that is not installed/on PATH of the worker process; PATH inside the SeaTunnel worker JVM differing from the interactive shell PATH.

Common situations: Interpreter installed only in a venv not on the worker's PATH; running SeaTunnel as a systemd service whose PATH is minimal; typo in the command name.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/e7aed1e0603b429c. Report an issue: GitHub.