dagger/dagger · error

%q is not installed as an SDK in this workspace; run `dagger

Error message

%q is not installed as an SDK in this workspace; run `dagger sdk install %s` first

What it means

Thrown by resolveConfiguredSDK when the requested SDK name cannot be resolved because the workspace config is nil or has no modules map — i.e. no SDKs are installed at all. It suggests `dagger sdk install <name>`.

Source

Thrown at internal/cmd/dagger/sdk_init_dynamic.go:164

		seen[commandName] = moduleName
		sdks = append(sdks, configuredSDK{
			moduleName:  moduleName,
			commandName: commandName,
			entry:       entry,
		})
	}
	sort.Slice(sdks, func(i, j int) bool {
		if sdks[i].commandName != sdks[j].commandName {
			return sdks[i].commandName < sdks[j].commandName
		}
		return sdks[i].moduleName < sdks[j].moduleName
	})
	return sdks, nil
}

func resolveConfiguredSDK(cfg *workspace.Config, sdkName string) (configuredSDK, error) {
	if cfg == nil || cfg.Modules == nil {
		return configuredSDK{}, fmt.Errorf("%q is not installed as an SDK in this workspace; run `dagger sdk install %s` first", sdkName, sdkName)
	}
	if entry, ok := cfg.Modules[sdkName]; ok && entry.AsSDK != nil {
		return configuredSDK{
			moduleName:  sdkName,
			commandName: sdkCommandName(sdkName, entry),
			entry:       entry,
		}, nil
	}

	var matches []configuredSDK
	for moduleName, entry := range cfg.Modules {
		if entry.AsSDK == nil || entry.AsSDK.Name != sdkName {
			continue
		}
		matches = append(matches, configuredSDK{
			moduleName:  moduleName,
			commandName: sdkCommandName(moduleName, entry),
			entry:       entry,

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Run `dagger sdk install <sdk>` first to add the SDK to the workspace config
  2. Verify dagger.json in the workspace root contains a modules entry with as-sdk for this SDK
  3. Check you are in the correct workspace (the config found may be an unrelated parent one)

Example fix

// before (dagger.json)
{ "modules": {} }
// after
$ dagger sdk install python
{ "modules": { "python": { "as-sdk": {} } } }
Defensive patterns

Strategy: validation

Validate before calling

test -f dagger.json && jq -e '.modules' dagger.json >/dev/null || { echo "no modules installed; run dagger sdk install <sdk>"; }

Try / catch

if err != nil && strings.Contains(err.Error(), "is not installed as an SDK") { fmt.Fprintln(os.Stderr, "Install the SDK first: dagger sdk install <sdk>"); os.Exit(1) }

Prevention

When it happens

Trigger: `dagger sdk uninstall <name>` or `dagger sdk init <name>` (init options flow) in a workspace whose dagger.json exists but has no `modules` entries, or when no workspace config was loaded (cfg == nil).

Common situations: Fresh workspace created with `dagger init` but no SDK ever installed; calling uninstall with the wrong expectation that an SDK is present; config file present but modules section empty.

Related errors


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/d30388d918128a30. Report an issue: GitHub.