{"record":{"id":"e2bdb4e46b6b99f7","repo":"chocolatey/choco","slug":"alternative-sources-do-not-allow-the-use-of-the-a-e2bdb4","errorCode":null,"errorMessage":"Alternative sources do not allow the use of the 'all' package name/keyword.","messagePattern":"Alternative sources do not allow the use of the 'all' package name/keyword\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/PythonService.cs","lineNumber":364,"sourceCode":"        }\r\n\r\n        public void InstallDryRun(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)\r\n        {\r\n            EnsureExecutablePathSet();\r\n            var args = BuildArguments(config, _installArguments);\r\n            this.Log().Info(\"Would have run '{0} {1}'\".FormatWith(_exePath.EscapeCurlyBraces(), args.EscapeCurlyBraces()));\r\n        }\r\n\r\n        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)\r\n        {\r\n            return Install(config, continueAction, beforeModifyAction: null);\r\n        }\r\n\r\n        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction, Action<PackageResult, ChocolateyConfiguration> beforeModifyAction)\r\n        {\r\n            if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))\r\n            {\r\n                throw new NotImplementedException(\"Alternative sources do not allow the use of the 'all' package name/keyword.\");\r\n            }\r\n\r\n            EnsureExecutablePathSet();\r\n            var args = BuildArguments(config, _installArguments);\r\n            var packageResults = new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);\r\n\r\n            foreach (var packageToInstall in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries))\r\n            {\r\n                var pkgName = packageToInstall;\r\n                if (!string.IsNullOrWhiteSpace(config.Version))\r\n                {\r\n                    pkgName = \"{0}=={1}\".FormatWith(packageToInstall, config.Version);\r\n                }\r\n                var argsForPackage = args.Replace(PackageNameToken, pkgName);\r\n\r\n                var exitCode = _commandExecutor.Execute(\r\n                    _exePath,\r\n                    argsForPackage,\r","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/PythonService.cs#L346-L382","documentation":"PythonService.Install rejects the 'all' keyword: alternative sources (Python/pip) cannot install all packages. If config.PackageNames equals ApplicationParameters.AllPackages it throws NotImplementedException immediately, before building any arguments.","triggerScenarios":"Calling choco install with PackageNames == 'all' against the Python source (SourceTypes.Python).","commonSituations":"A script reuses an 'all' package-name variable across sources; misunderstanding that the pip source is per-package; copy-paste from a NuGet-style 'all' command.","solutions":["List and install explicit package names with the Python source","Do not pass 'all' to alternative (Python/Ruby/Cygwin/WindowsFeatures) sources","Loop over a package list in your script instead of using 'all'"],"exampleFix":"// before\nchoco install all --source=python\n// after\nchoco install requests flask --source=python","handlingStrategy":"validation","validationCode":"if (config.PackageNames == ApplicationParameters.AllPackages) {\n    throw new ArgumentException(\"The Python source does not support 'all'; pass explicit package names.\");\n}","typeGuard":null,"tryCatchPattern":"try { pythonService.Install(config); }\ncatch (NotImplementedException ex) when (ex.Message.Contains(\"'all'\")) {\n    logger.Error(ex.Message); // pass explicit names\n}","preventionTips":["Never pass 'all' to the Python (or other alternative) source","Enumerate packages explicitly in scripts","Validate PackageNames against the source type before invoking"],"tags":["python","all-packages","install"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}