{"record":{"id":"296eac0c6aec3dbb","repo":"Devolutions/UniGetUI","slug":"microsoft-store-python-alias-is-not-a-valid-python","errorCode":null,"errorMessage":"Microsoft Store python alias is not a valid python install","messagePattern":"Microsoft Store python alias is not a valid python install","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.PackageEngine.Managers.Pip/Pip.cs","lineNumber":518,"sourceCode":"            {\n                StartInfo = new ProcessStartInfo\n                {\n                    FileName = Status.ExecutablePath,\n                    Arguments = Status.ExecutableCallArgs + \"--version \" + GetProxyArgument(),\n                    UseShellExecute = false,\n                    RedirectStandardOutput = true,\n                    RedirectStandardError = true,\n                    CreateNoWindow = true,\n                    StandardOutputEncoding = System.Text.Encoding.UTF8,\n                },\n            };\n            process.Start();\n            version = process.StandardOutput.ReadToEnd().Trim();\n            process.WaitForExit();\n\n            if (process.ExitCode is 9009)\n            {\n                throw new InvalidOperationException(\n                    \"Microsoft Store python alias is not a valid python install\"\n                );\n            }\n        }\n\n        protected override void _performExtraLoadingSteps()\n        {\n            Environment.SetEnvironmentVariable(\n                \"PIP_REQUIRE_VIRTUALENV\",\n                \"false\",\n                EnvironmentVariableTarget.Process\n            );\n\n            // Pre-warm the package name index in the background so the first search doesn't\n            // need to wait for the ~38 MB download inside the search timeout window.\n            Task.Run(() =>\n            {\n                var logger = TaskLogger.CreateNew(LoggableTaskType.FindPackages);","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.PackageEngine.Managers.Pip/Pip.cs#L500-L536","documentation":"Pip._loadManagerVersion runs 'python --version' (or the resolved executable) and, when the exit code is 9009, throws InvalidOperationException. Exit 9009 is the Windows shell indicator that the command resolved to the Microsoft Store 'python' app stub, which is not a real Python install.","triggerScenarios":"The discovered python executable is the Windows Store alias (%LOCALAPPDATA%\\Microsoft\\WindowsApps\\python.exe) which prints nothing and exits 9009 instead of a version.","commonSituations":"Fresh Windows install where only the Store alias exists; user disabled the Store alias but PATH still points at WindowsApps; python.org Python not installed.","solutions":["Install real Python from python.org (or via winget: Python.Python.3.12) and ensure it precedes the Store alias on PATH.","Disable the Microsoft Store 'App execution aliases' for python.exe/python3.exe in Windows Settings.","Point UniGetUI's pip executable setting at the real python.exe path."],"exampleFix":"# before: only the Store alias is on PATH -> exit 9009 -> InvalidOperationException\n# after: install real python and disable the alias\nwinget install Python.Python.3.12\n# Windows Settings > Apps > Advanced app settings > App execution aliases -> python off","handlingStrategy":"validation","validationCode":"// Detect the Store alias path before trusting the executable.\nif (Status.ExecutablePath.Contains(\"WindowsApps\", StringComparison.OrdinalIgnoreCase))\n    throw new InvalidOperationException(\"Resolved python is the Store alias; install real Python.\");","typeGuard":"static bool IsStoreAlias(string path) =>\n    path.Contains(\"WindowsApps\", StringComparison.OrdinalIgnoreCase);","tryCatchPattern":null,"preventionTips":["Install Python from python.org (or winget Python.Python.3.x).","Disable Windows Store 'App execution aliases' for python.exe/python3.exe.","Set UniGetUI's pip executable to the real python.exe path."],"tags":["pip","python","windows","microsoft-store-alias","exit-code-9009"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}