crewAIInc/crewAI · error · ImportError

`multion` package not found, please run `uv add multion`

Error message

`multion` package not found, please run `uv add multion`

What it means

MultiOnTool's constructor tries to import multion.client.MultiOn; on ImportError it interactively offers `uv add multion`. Declining the click.confirm prompt — or running where no TTY exists so the prompt fails — raises this ImportError. Unlike some tools, this one is explicitly uv-oriented in its guidance.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/multion_tool/multion_tool.py:48

    def __init__(
        self,
        api_key: str | None = None,
        **kwargs: Any,
    ):
        super().__init__(**kwargs)
        try:
            from multion.client import MultiOn
        except ImportError:
            import click

            if click.confirm(
                "You are missing the 'multion' package. Would you like to install it?"
            ):
                subprocess.run(["uv", "add", "multion"], check=True)  # noqa: S607
                from multion.client import MultiOn
            else:
                raise ImportError(
                    "`multion` package not found, please run `uv add multion`"
                ) from None
        self.session_id = None
        self.multion = MultiOn(api_key=api_key or os.getenv("MULTION_API_KEY"))

    def _run(
        self,
        cmd: str,
        *args: Any,
        **kwargs: Any,
    ) -> str:
        """Run the Multion client with the given command.

        Args:
            cmd (str): The detailed and specific natural language instructrion for web browsing

            *args (Any): Additional arguments to pass to the Multion client
            **kwargs (Any): Additional keyword arguments to pass to the Multion client

View on GitHub (pinned to 754d7323be)

Solutions

  1. Install the package: `uv add multion` or `pip install multion`
  2. Add multion to pinned dependencies for CI to avoid the prompt entirely
  3. Set MULTION_API_KEY so MultiOn(api_key=...) initializes after install

Example fix

# before
tool = MultiOnTool()  # ImportError

# after
# uv add multion
import os
os.environ["MULTION_API_KEY"] = "..."
tool = MultiOnTool()
Defensive patterns

Strategy: validation

Validate before calling

def multion_available() -> bool:
    try:
        from multion.client import MultiOn  # noqa: F401
        return True
    except ImportError:
        return False

assert multion_available(), "uv add multion"

Try / catch

try:
    tool = MultiOnTool()
except ImportError as e:
    raise RuntimeError("Install multion first: uv add multion") from e

Prevention

When it happens

Trigger: Instantiating MultiOnTool() without the multion package; CI/containers with no interactive stdin; answering 'no'; `uv` missing from PATH.

Common situations: Fresh envs with only crewai-tools installed; Docker deployments where click.confirm receives EOF; pipelines that cannot prompt.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/015f473f0ae6c27a. Report an issue: GitHub.