langchain-ai/deepagents · error · MarketplaceError

Path does not exist: {path}

Error message

Path does not exist: {path}

What it means

`_marketplace_source_from_path` resolves the given path (`expanduser().resolve()`) and raises this error if nothing exists at that location (marketplace.py:217-221). The library requires local marketplace sources to point at a real file or directory before it will create a `LocalMarketplaceSource`. Note the message contains the resolved absolute path, which may differ from what the user typed.

Source

Thrown at libs/code/deepagents_code/plugins/marketplace.py:221

    if (
        "/" in value
        and ":" not in value
        and not value.startswith("@")
        and _GITHUB_REPO_RE.match(repo)
    ):
        return RepositoryMarketplaceSource(
            source_type="github", value=repo, ref=ref if sep else None
        )

    msg = "Invalid marketplace source format. Try: owner/repo, https://..., or ./path"
    raise MarketplaceError(msg)


def _marketplace_source_from_path(value: str) -> MarketplaceSource:
    path = Path(value).expanduser().resolve()
    if not path.exists():
        msg = f"Path does not exist: {path}"
        raise MarketplaceError(msg)
    if path.is_file():
        if path.suffix != ".json":
            msg = f"File path must point to a .json marketplace file: {path}"
            raise MarketplaceError(msg)
        return LocalMarketplaceSource(source_type="file", value=str(path))
    if path.is_dir():
        return LocalMarketplaceSource(source_type="directory", value=str(path))
    msg = f"Path is neither a file nor a directory: {path}"
    raise MarketplaceError(msg)


def _root_for_marketplace_file(path: Path) -> Path:
    for relative in _MARKETPLACE_RELATIVE_PATHS:
        if (
            len(path.parts) >= len(relative.parts)
            and path.parts[-len(relative.parts) :] == relative.parts
        ):
            return path.parents[len(relative.parts) - 1]

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Verify the path exists with `ls`/`test -e` relative to your current working directory.
  2. Use an absolute path or `~/` prefix to remove working-directory ambiguity.
  3. Clone or create the local marketplace repository first, then re-run the add command.

Example fix

// before
add_marketplace_source("./my-plugins")   # directory absent
// after
git clone https://github.com/owner/my-plugins.git
add_marketplace_source("./my-plugins")
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def validate_existing_path(raw: str) -> str:
    p = Path(raw).expanduser().resolve()
    if not p.exists():
        raise FileNotFoundError(f"Marketplace path does not exist: {p}")
    return raw

Type guard

from pathlib import Path

def is_existing_file_or_dir(value: str) -> bool:
    p = Path(value).expanduser().resolve()
    return p.is_file() or p.is_dir()

Try / catch

try:
    source = parse_marketplace_source(raw)
except MarketplaceError as exc:
    if str(exc).startswith("Path does not exist"):
        raise ValueError(
            f"{exc} — check the working directory and spelling of {raw!r}"
        ) from exc
    raise

Prevention

When it happens

Trigger: `parse_marketplace_source('./missing-dir')`, `'~/no-such/marketplace.json'`, `'/abs/path/that/does/not/exist'`, or a bare relative name that does not exist on disk and falls through to this helper. Raised via `add_marketplace_source` or `_plugin_repository_source`.

Common situations: Typos in the directory name; running the command from a different working directory than expected (relative path resolves elsewhere); deleting or renaming a local marketplace checkout after registering it in config; `~` expansion pointing to another user's home.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/d21601f2c82f70a5. Report an issue: GitHub.