{"record":{"id":"a11c5b81e4451789","repo":"crewAIInc/crewAI","slug":"failed-to-install-firecrawl-py-package","errorCode":null,"errorMessage":"Failed to install firecrawl-py package","messagePattern":"Failed to install firecrawl-py package","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/firecrawl_crawl_website_tool/firecrawl_crawl_website_tool.py","lineNumber":101,"sourceCode":"        try:\n            from firecrawl import FirecrawlApp\n\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(self, url: str) -> Any:\n        if not self._firecrawl:\n            raise RuntimeError(\"FirecrawlApp not properly initialized\")\n\n        url = validate_url(url)\n        return self._firecrawl.crawl(url=url, poll_interval=2, **self.config)\n\n\ntry:\n    from firecrawl import FirecrawlApp  # noqa: F401\n\n    if not getattr(FirecrawlCrawlWebsiteTool, \"_model_rebuilt\", False):\n        FirecrawlCrawlWebsiteTool.model_rebuild()","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/firecrawl_crawl_website_tool/firecrawl_crawl_website_tool.py#L83-L119","documentation":"Raised by FirecrawlCrawlWebsiteTool.__init__ when the user accepted the interactive install prompt ('uv add firecrawl-py') but the subprocess install failed (non-zero exit). The CalledProcessError is chained as the cause, so the real failure (network error, uv not on PATH, resolver conflict) is visible in the exception chain.","triggerScenarios":"Answering 'y' to the install prompt in an environment where 'uv' is not installed, is an old version, or cannot resolve firecrawl-py (offline machine, locked-down registry, dependency conflict).","commonSituations":"Containers/CI images without uv on PATH; air-gapped or proxied networks blocking the package index; pip-only environments where uv was never installed.","solutions":["Install firecrawl-py manually and inspect the real error: pip install firecrawl-py (or uv add firecrawl-py) in your shell.","If uv is missing, install it (curl -LsSf https://astral.sh/uv/install.sh | sh) or rely on pip instead — the prompt only tries uv.","Check the chained CalledProcessError (__cause__) for the underlying reason (offline, version conflict) and fix that."],"exampleFix":"# before: prompt accepted, uv install fails -> ImportError\n# after: shell\n#   pip install firecrawl-py\ntool = FirecrawlCrawlWebsiteTool(api_key=FIRECRAWL_API_KEY)","handlingStrategy":"try-catch","validationCode":"def firecrawl_available() -> bool:\n    try:\n        import firecrawl  # noqa: F401\n        return True\n    except ImportError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    tool = FirecrawlCrawlWebsiteTool(api_key=KEY)\nexcept ImportError as e:\n    print(f'install failed or declined ({e}); cause: {e.__cause__}')\n    subprocess.run([sys.executable, '-m', 'pip', 'install', 'firecrawl-py'], check=True)\n    tool = FirecrawlCrawlWebsiteTool(api_key=KEY)","preventionTips":["Install firecrawl-py before runtime; never rely on the interactive uv prompt in automation.","Check e.__cause__ (CalledProcessError) to diagnose uv failures."],"tags":["firecrawl","dependency","subprocess","install-failure","optional-deps"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}