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 FirecrawlSearchTool.__init__ when firecrawl-py is absent and the user declined the auto-install prompt. It is the deliberate abort branch: the tool refuses to construct a client without the package and names the install command to run.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/firecrawl_search_tool/firecrawl_search_tool.py:102

            self._firecrawl = FirecrawlApp(api_key=self.api_key)
        except ImportError:
            import click

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

                try:
                    subprocess.run(["uv", "add", "firecrawl-py"], check=True)  # noqa: S607
                    from firecrawl import FirecrawlApp

                    self._firecrawl = FirecrawlApp(api_key=self.api_key)
                except subprocess.CalledProcessError as e:
                    raise ImportError("Failed to install firecrawl-py package") from e
            else:
                raise ImportError(
                    "`firecrawl-py` package not found, please run `uv add firecrawl-py`"
                ) from None

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

        return self._firecrawl.search(
            query=query,
            **self.config,
        )


try:
    from firecrawl import FirecrawlApp  # noqa: F401

View on GitHub (pinned to 754d7323be)

Solutions

  1. Install the package: uv add firecrawl-py or pip install firecrawl-py.
  2. Declare it in project dependencies/lockfile.
  3. Bake it into CI images ahead of time.

Example fix

# before: prompt declined -> ImportError
# after: shell
#   pip install firecrawl-py
tool = FirecrawlSearchTool(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 = FirecrawlSearchTool(api_key=KEY)
except ImportError as e:
    raise SystemExit('pre-install firecrawl-py (non-interactive env)') from e

Prevention

When it happens

Trigger: Instantiating FirecrawlSearchTool without firecrawl-py and answering 'n' (or running where click.confirm cannot get a 'y').

Common situations: Non-interactive CI/CD; Docker builds; users who intentionally decline automatic dependency installation.

Related errors


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