{"record":{"id":"156cb9ed51ab83fa","repo":"crewAIInc/crewAI","slug":"firecrawl-py-package-not-found-please-run-uv-a-156cb9","errorCode":null,"errorMessage":"`firecrawl-py` package not found, please run `uv add firecrawl-py`","messagePattern":"`firecrawl-py` package not found, please run `uv add firecrawl-py`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/firecrawl_search_tool/firecrawl_search_tool.py","lineNumber":102,"sourceCode":"\n            self._firecrawl = FirecrawlApp(api_key=self.api_key)\n        except ImportError:\n            import click\n\n            if click.confirm(\n                \"You are missing the 'firecrawl-py' package. Would you like to install it?\"\n            ):\n                import subprocess\n\n                try:\n                    subprocess.run([\"uv\", \"add\", \"firecrawl-py\"], check=True)  # noqa: S607\n                    from firecrawl import FirecrawlApp\n\n                    self._firecrawl = FirecrawlApp(api_key=self.api_key)\n                except subprocess.CalledProcessError as e:\n                    raise ImportError(\"Failed to install firecrawl-py package\") from e\n            else:\n                raise ImportError(\n                    \"`firecrawl-py` package not found, please run `uv add firecrawl-py`\"\n                ) from None\n\n    def _run(\n        self,\n        query: str,\n    ) -> Any:\n        if not self._firecrawl:\n            raise RuntimeError(\"FirecrawlApp not properly initialized\")\n\n        return self._firecrawl.search(\n            query=query,\n            **self.config,\n        )\n\n\ntry:\n    from firecrawl import FirecrawlApp  # noqa: F401","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/firecrawl_search_tool/firecrawl_search_tool.py#L84-L120","documentation":"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.","triggerScenarios":"Instantiating FirecrawlSearchTool without firecrawl-py and answering 'n' (or running where click.confirm cannot get a 'y').","commonSituations":"Non-interactive CI/CD; Docker builds; users who intentionally decline automatic dependency installation.","solutions":["Install the package: uv add firecrawl-py or pip install firecrawl-py.","Declare it in project dependencies/lockfile.","Bake it into CI images ahead of time."],"exampleFix":"# before: prompt declined -> ImportError\n# after: shell\n#   pip install firecrawl-py\ntool = FirecrawlSearchTool(api_key=FIRECRAWL_API_KEY)","handlingStrategy":"try-catch","validationCode":"try:\n    import firecrawl  # noqa: F401\nexcept ImportError:\n    raise SystemExit('firecrawl-py required: pip install firecrawl-py')","typeGuard":null,"tryCatchPattern":"try:\n    tool = FirecrawlSearchTool(api_key=KEY)\nexcept ImportError as e:\n    raise SystemExit('pre-install firecrawl-py (non-interactive env)') from e","preventionTips":["Declare firecrawl-py in requirements for all environments using this tool.","Keep automated runs free of interactive dependency prompts."],"tags":["firecrawl","import-error","dependency","interactive-prompt","optional-deps"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}