langchain-ai/langgraph · error · ValueError

Package name '{resolved.name}' contains a hyphen. Rename the

Error message

Package name '{resolved.name}' contains a hyphen. Rename the directory to use it as flat-layout package.

What it means

Error "Package name '{resolved.name}' contains a hyphen. Rename the directory to use it as flat-layout package." thrown in langchain-ai/langgraph.

Source

Thrown at libs/cli/langgraph_cli/config.py:786

        if "pyproject.toml" in files or "setup.py" in files:
            # real package

            # assign a unique folder name
            container_name = resolved.name
            if counter[container_name] > 0:
                container_name += f"_{counter[container_name]}"
            counter[container_name] += 1
            # add to deps
            real_pkgs[resolved] = (local_dep, container_name)
            # set working_dir
            if local_dep == ".":
                working_dir = f"/deps/{container_name}"
        else:
            # We could not find a pyproject.toml or setup.py, so treat as a faux package
            if any(file == "__init__.py" for file in files):
                # flat layout
                if "-" in resolved.name:
                    raise ValueError(
                        f"Package name '{resolved.name}' contains a hyphen. "
                        "Rename the directory to use it as flat-layout package."
                    )
                check_reserved(resolved.name, local_dep)
                container_path = f"/deps/outer-{resolved.name}/{resolved.name}"
            else:
                # src layout
                container_path = f"/deps/outer-{resolved.name}/src"
                for file in files:
                    rfile = resolved / file
                    if (
                        rfile.is_dir()
                        and file != "__pycache__"
                        and not file.startswith(".")
                    ):
                        try:
                            for subfile in os.listdir(rfile):
                                if subfile.endswith(".py"):

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/cli/langgraph_cli/config.py:786 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/2238095d53b10887. Report an issue: GitHub.