{"record":{"id":"e7aed1e0603b429c","repo":"apache/seatunnel","slug":"unable-to-resolve-python-executable-from-path","errorCode":null,"errorMessage":"Unable to resolve python.executable from PATH: {}","messagePattern":"Unable to resolve python\\.executable from PATH: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceExecutionPolicy.java","lineNumber":112,"sourceCode":"        if (allowedExecutables.isEmpty()) {\n            throw new IllegalStateException(\n                    \"Server property \"\n                            + PYTHON_ALLOWED_EXECUTABLES_PROPERTY\n                            + \" does not contain a usable absolute path\");\n        }\n        return new ArrayList<>(allowedExecutables);\n    }\n\n    private static Path resolveConfiguredExecutable(String configuredExecutable)\n            throws IOException {\n        Path configuredPath = Paths.get(configuredExecutable);\n        Path resolvedPath;\n        if (configuredPath.isAbsolute()) {\n            resolvedPath = normalize(configuredPath);\n        } else if (configuredPath.getParent() == null) {\n            resolvedPath = resolveCommandFromPath(configuredExecutable);\n            if (resolvedPath == null) {\n                throw new IOException(\n                        \"Unable to resolve python.executable from PATH: \" + configuredExecutable);\n            }\n        } else {\n            throw new IllegalStateException(\n                    \"python.executable must be an absolute path or a bare command name: \"\n                            + configuredExecutable);\n        }\n        if (!Files.isRegularFile(resolvedPath) || !Files.isExecutable(resolvedPath)) {\n            throw new IOException(\n                    \"python.executable does not resolve to an executable file: \" + resolvedPath);\n        }\n        return resolvedPath;\n    }\n\n    private static Path resolveCommandFromPath(String command) {\n        String pathValue = System.getenv(\"PATH\");\n        if (pathValue == null || pathValue.trim().isEmpty()) {\n            return null;","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceExecutionPolicy.java#L94-L130","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the absolute interpreter path instead of a bare command, e.g. /usr/bin/python3.11","Ensure the interpreter is on PATH of the user running SeaTunnel (check echo $PATH inside that environment)","Make sure the name is also present in the python.allowed.executables allowlist"],"exampleFix":"// before\npythonExecutable = \"python3.11\"\n// after\npythonExecutable = \"/usr/local/bin/python3.11\"","handlingStrategy":"validation","validationCode":"String exe = config.getPythonExecutable();\nif (exe.contains(\"/\")) {\n    if (!Paths.get(exe).isAbsolute()) throw new IllegalArgumentException(\"Use absolute path: \" + exe);\n} else if (Arrays.stream(System.getenv(\"PATH\").split(\":\")).noneMatch(d -> new File(d, exe).canExecute())) {\n    throw new IllegalArgumentException(\"Not on PATH: \" + exe);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer absolute interpreter paths over bare command names","Check PATH of the service user, not the interactive shell","Keep interpreter installations consistent across workers"],"tags":["python","path","configuration"],"backgroundTag":"command-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}