chocolatey/choco · error · NotImplementedException

Alternative sources do not allow the use of the 'all' packag

Error message

Alternative sources do not allow the use of the 'all' package name/keyword.

What it means

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.

Source

Thrown at src/chocolatey/infrastructure.app/services/PythonService.cs:364

        }

        public void InstallDryRun(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            EnsureExecutablePathSet();
            var args = BuildArguments(config, _installArguments);
            this.Log().Info("Would have run '{0} {1}'".FormatWith(_exePath.EscapeCurlyBraces(), args.EscapeCurlyBraces()));
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            return Install(config, continueAction, beforeModifyAction: null);
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction, Action<PackageResult, ChocolateyConfiguration> beforeModifyAction)
        {
            if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))
            {
                throw new NotImplementedException("Alternative sources do not allow the use of the 'all' package name/keyword.");
            }

            EnsureExecutablePathSet();
            var args = BuildArguments(config, _installArguments);
            var packageResults = new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);

            foreach (var packageToInstall in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries))
            {
                var pkgName = packageToInstall;
                if (!string.IsNullOrWhiteSpace(config.Version))
                {
                    pkgName = "{0}=={1}".FormatWith(packageToInstall, config.Version);
                }
                var argsForPackage = args.Replace(PackageNameToken, pkgName);

                var exitCode = _commandExecutor.Execute(
                    _exePath,
                    argsForPackage,

View on GitHub (pinned to 0d5abdd10c)

Solutions

  1. List and install explicit package names with the Python source
  2. Do not pass 'all' to alternative (Python/Ruby/Cygwin/WindowsFeatures) sources
  3. Loop over a package list in your script instead of using 'all'

Example fix

// before
choco install all --source=python
// after
choco install requests flask --source=python
Defensive patterns

Strategy: validation

Validate before calling

if (config.PackageNames == ApplicationParameters.AllPackages) {
    throw new ArgumentException("The Python source does not support 'all'; pass explicit package names.");
}

Try / catch

try { pythonService.Install(config); }
catch (NotImplementedException ex) when (ex.Message.Contains("'all'")) {
    logger.Error(ex.Message); // pass explicit names
}

Prevention

When it happens

Trigger: Calling choco install with PackageNames == 'all' against the Python source (SourceTypes.Python).

Common situations: 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.

Related errors


AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13). Data as JSON: /api/errors/e2bdb4e46b6b99f7. Report an issue: GitHub.