{"record":{"id":"1e46d8232be9afd1","repo":"chocolatey/choco","slug":"this-source-is-not-supported-on-non-windows-system-1e46d8","errorCode":null,"errorMessage":"This source is not supported on non-Windows systems","messagePattern":"This source is not supported on non-Windows systems","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/PythonService.cs","lineNumber":178,"sourceCode":"            {\r\n                ArgumentOption = \"\",\r\n                ArgumentValue = ForceToken,\r\n                QuoteValue = false,\r\n                UseValueOnly = true,\r\n                Required = true\r\n            });\r\n        }\r\n\r\n        public string SourceType\r\n        {\r\n            get { return SourceTypes.Python; }\r\n        }\r\n\r\n        public void EnsureSourceAppInstalled(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> ensureAction)\r\n        {\r\n            if (Platform.GetPlatform() != PlatformType.Windows)\r\n            {\r\n                throw new NotImplementedException(\"This source is not supported on non-Windows systems\");\r\n            }\r\n\r\n            //ensure at least python 2.7.9 is installed\r\n            var python = _fileSystem.GetExecutablePath(\"python\");\r\n            //python -V\r\n\r\n            if (python.IsEqualTo(\"python\"))\r\n            {\r\n                var runnerConfig = new ChocolateyConfiguration\r\n                {\r\n                    Sources = ApplicationParameters.PackagesLocation,\r\n                    Debug = config.Debug,\r\n                    Force = config.Force,\r\n                    Verbose = config.Verbose,\r\n                    CommandExecutionTimeoutSeconds = config.CommandExecutionTimeoutSeconds,\r\n                    CacheLocation = config.CacheLocation,\r\n                    RegularOutput = config.RegularOutput,\r\n                    PromptForConfirmation = false,\r","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/PythonService.cs#L160-L196","documentation":"PythonService.EnsureSourceAppRegistered throws NotImplementedException on non-Windows platforms. The Python (pip) source type is implemented only for Windows, so any attempt to initialize it elsewhere fails fast.","triggerScenarios":"Using the Python source type (--source python or SourceTypes.Python) on Linux or macOS where Platform.GetPlatform() != PlatformType.Windows, when the source is ensured/initialized.","commonSituations":"Running Chocolatey CLI on Linux/macOS attempting to manage pip packages; cross-platform scripts that assume Windows; CI matrix including non-Windows nodes.","solutions":["Run Python-source commands on a Windows host only","Manage Python packages with pip directly on non-Windows systems","Guard Python-source commands on platform before invoking them"],"exampleFix":"// before\nchoco install requests --source=python  # on Linux\n// after\n# on non-Windows, use pip directly:\npip install requests","handlingStrategy":"type-guard","validationCode":"if (Platform.GetPlatform() != PlatformType.Windows) {\n    Console.Error.WriteLine(\"Python source is Windows-only; use pip directly.\");\n    return;\n}","typeGuard":"static bool IsPythonSourceSupported() => Platform.GetPlatform() == PlatformType.Windows;","tryCatchPattern":null,"preventionTips":["Gate Python-source commands behind a Windows platform check","Do not include the python source in cross-platform scripts","Use pip directly to manage Python packages on Linux/macOS"],"tags":["platform","python","cross-platform"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}