{"record":{"id":"ebddfebfc05b5f4d","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-python-executable-found","errorCode":null,"errorMessage":"no python executable found","messagePattern":"no python executable found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/segments/python.go","lineNumber":179,"sourceCode":"\t\t\tlog.Debugf(\"virtual env name %s is invalid\", name)\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (p *Python) pyenvVersion() (string, error) {\n\t// Use `pyenv root` instead of $PYENV_ROOT?\n\t// Is our Python executable at $PYENV_ROOT/bin/python ?\n\t// Should p.env expose command paths?\n\tcmdPath := p.env.CommandPath(pythonToolName)\n\tif cmdPath == \"\" {\n\t\tcmdPath = p.env.CommandPath(python3ToolName)\n\t}\n\n\tif cmdPath == \"\" {\n\t\treturn \"\", errors.New(\"no python executable found\")\n\t}\n\n\tpyEnvRoot := p.env.Getenv(\"PYENV_ROOT\")\n\tif pyEnvRoot == \"\" || !strings.HasPrefix(cmdPath, pyEnvRoot) {\n\t\treturn \"\", fmt.Errorf(\"executable at %s is not a pyenv shim\", cmdPath)\n\t}\n\n\t// pyenv version-name will return current version or virtualenv\n\tcmdOutput, err := p.env.RunCommand(\"pyenv\", \"version-name\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tversionString, _, found := strings.Cut(cmdOutput, \":\")\n\tif !found || versionString == \"\" {\n\t\treturn \"\", errors.New(\"no pyenv version-name found\")\n\t}\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/python.go#L161-L197","documentation":"Raised by the python segment's pyenv tooling path: it looks up the absolute path of python (then python3) via the environment's CommandPath, and if neither resolves on PATH it cannot determine any Python version, so it fails with this error.","triggerScenarios":"The pyenv tool entry runs (it is first in the default tooling order) but no python/python3 binary exists on PATH — Python not installed, not added to PATH, or running in an environment (container, CI, minimal shell) without it.","commonSituations":"Fresh machine with pyenv installed but no Python version installed through it, PATH not updated in the shell spawning oh-my-posh (e.g. GUI-launched terminals), Windows without Python from the Store, or stripped-down Docker images.","solutions":["Install Python (or a pyenv-managed version: pyenv install 3.x && pyenv global 3.x).","Ensure python/python3 are on PATH in the shell that launches oh-my-posh (check PATH in .zshrc/.bashrc/profile).","If you do not want pyenv handling, set the tooling option to skip \"pyenv\" and rely on other executables.","Verify with `which python3` (or `where.exe python3` on Windows) in the same shell context."],"exampleFix":"// before (PATH missing python)\nexport PATH=\"$HOME/bin:$PATH\"\n// after\nexport PATH=\"$PYENV_ROOT/bin:$PYENV_ROOT/shims:$HOME/bin:$PATH\"\n# and: pyenv global 3.12.1","handlingStrategy":"validation","validationCode":"if ! command -v python3 >/dev/null 2>&1 && ! command -v python >/dev/null 2>&1; then\n  echo \"python/python3 not on PATH; install Python or fix PATH before enabling the segment\"\nfi","typeGuard":null,"tryCatchPattern":"version, err := p.pyenvVersion()\nif err != nil {\n  if err.Error() == \"no python executable found\" {\n    return \"\" // no Python installed — hide the segment quietly\n  }\n  return \"\", err\n}","preventionTips":["Install Python (system package, pyenv, or uv-managed) on every machine using the segment.","Ensure PATH includes python/python3 in non-interactive/login shells that spawn the prompt.","Prefer the tooling option to reorder probes (e.g. uv) in minimal environments.","Check with `which python3` in the exact shell context where oh-my-posh runs."],"tags":["python","pyenv","path","executable-not-found"],"backgroundTag":"executable-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}