{"record":{"id":"4bcc1219ab4cb586","repo":"crewAIInc/crewAI","slug":"failed-to-install-oxylabs-package-4bcc12","errorCode":null,"errorMessage":"Failed to install oxylabs package","messagePattern":"Failed to install oxylabs package","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/oxylabs_google_search_scraper_tool/oxylabs_google_search_scraper_tool.py","lineNumber":140,"sourceCode":"        else:\n            import click\n\n            if click.confirm(\n                \"You are missing the 'oxylabs' package. Would you like to install it?\"\n            ):\n                import subprocess\n\n                try:\n                    subprocess.run([\"uv\", \"add\", \"oxylabs\"], check=True)  # noqa: S607\n                    from oxylabs import RealtimeClient\n\n                    kwargs[\"oxylabs_api\"] = RealtimeClient(\n                        username=username,\n                        password=password,\n                        sdk_type=sdk_type,\n                    )\n                except subprocess.CalledProcessError as e:\n                    raise ImportError(\"Failed to install oxylabs package\") from e\n            else:\n                raise ImportError(\n                    \"`oxylabs` package not found, please run `uv add oxylabs`\"\n                )\n\n        if config is None:\n            config = OxylabsGoogleSearchScraperConfig()\n        super().__init__(config=config, **kwargs)\n\n    def _get_credentials_from_env(self) -> tuple[str, str]:\n        username = os.environ.get(\"OXYLABS_USERNAME\")\n        password = os.environ.get(\"OXYLABS_PASSWORD\")\n        if not username or not password:\n            raise ValueError(\n                \"You must pass oxylabs username and password when instantiating the tool \"\n                \"or specify OXYLABS_USERNAME and OXYLABS_PASSWORD environment variables\"\n            )\n        return username, password","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/oxylabs_google_search_scraper_tool/oxylabs_google_search_scraper_tool.py#L122-L158","documentation":"The Google search scraper variant of the auto-install flow: oxylabs missing, user accepts the click.confirm prompt, `uv add oxylabs` raises CalledProcessError, and ImportError('Failed to install oxylabs package') propagates from OxylabsGoogleSearchScraperTool.__init__.","triggerScenarios":"Constructing OxylabsGoogleSearchScraperTool without oxylabs, answering yes, while uv fails — typically because there is no uv-managed project (pyproject.toml/lock) in the current directory, uv is not installed, or PyPI is unreachable.","commonSituations":"Using pip/poetry/pdm-managed projects where `uv add` is the wrong command; offline or proxied CI environments.","solutions":["Install oxylabs with your actual package manager: pip install oxylabs.","If using uv, run from the uv project root so `uv add oxylabs` succeeds.","Check the __cause__ output for uv's specific error and fix network/proxy issues."],"exampleFix":"# before: auto-install path fails\n# (click.confirm yes -> uv add oxylabs fails)\n\n# after: explicit install\npip install oxylabs","handlingStrategy":"try-catch","validationCode":"try:\n    import oxylabs  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"Install oxylabs first: pip install oxylabs\")","typeGuard":null,"tryCatchPattern":"try:\n    tool = OxylabsGoogleSearchScraperTool(username=u, password=p)\nexcept ImportError as e:\n    raise SystemExit(f\"oxylabs install failed: {e.__cause__}\") from e","preventionTips":["Install oxylabs at image build time.","Only use `uv add` inside an actual uv project.","Inspect the chained CalledProcessError output for the root cause."],"tags":["oxylabs","dependency","uv","install","scraping"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}