crewAIInc/crewAI · error · ImportError

`firecrawl-py` package not found, please run `uv add firecra

Error message

`firecrawl-py` package not found, please run `uv add firecrawl-py`

What it means

Raised by FirecrawlScrapeWebsiteTool.__init__ when the 'firecrawl-py' package is missing and the user declined the interactive 'uv add firecrawl-py' prompt. Same opt-out pattern as the other Firecrawl tools: without the package the client cannot be built, so construction aborts with the install command in the message.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/firecrawl_scrape_website_tool/firecrawl_scrape_website_tool.py:101

    def __init__(self, api_key: str | None = None, **kwargs: Any) -> None:
        super().__init__(**kwargs)
        try:
            from firecrawl import FirecrawlApp
        except ImportError:
            import click

            if click.confirm(
                "You are missing the 'firecrawl-py' package. Would you like to install it?"
            ):
                import subprocess

                subprocess.run(["uv", "add", "firecrawl-py"], check=True)  # noqa: S607
                from firecrawl import (
                    FirecrawlApp,
                )
            else:
                raise ImportError(
                    "`firecrawl-py` package not found, please run `uv add firecrawl-py`"
                ) from None

        self._firecrawl = FirecrawlApp(api_key=api_key)

    def _run(self, url: str) -> Any:
        if not self._firecrawl:
            raise RuntimeError("FirecrawlApp not properly initialized")

        url = validate_url(url)
        return self._firecrawl.scrape(url=url, **self.config)


try:
    from firecrawl import FirecrawlApp  # noqa: F401

    if not getattr(FirecrawlScrapeWebsiteTool, "_model_rebuilt", False):
        FirecrawlScrapeWebsiteTool.model_rebuild()

View on GitHub (pinned to 754d7323be)

Solutions

  1. Install it: pip install firecrawl-py (or uv add firecrawl-py).
  2. Add it to project dependencies so every environment has it.
  3. Pre-install in Docker/CI to avoid the interactive prompt entirely.

Example fix

# before: prompt declined -> ImportError
# after: shell
#   pip install firecrawl-py
tool = FirecrawlScrapeWebsiteTool(api_key=FIRECRAWL_API_KEY)
Defensive patterns

Strategy: try-catch

Validate before calling

try:
    import firecrawl  # noqa: F401
except ImportError:
    raise SystemExit('firecrawl-py required: pip install firecrawl-py')

Try / catch

try:
    tool = FirecrawlScrapeWebsiteTool(api_key=KEY)
except ImportError:
    raise SystemExit('pre-install firecrawl-py before instantiating scrape tool')

Prevention

When it happens

Trigger: Instantiating FirecrawlScrapeWebsiteTool in an environment lacking firecrawl-py and answering 'n' to the confirm; non-interactive shells where the prompt cannot be answered.

Common situations: CI and containerized builds without the optional dep; fresh clones; automated deployment scripts that must not prompt.

Related errors


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