{"record":{"id":"1b114edc2705d4da","repo":"crewAIInc/crewAI","slug":"failed-to-install-snowflake-dependencies","errorCode":null,"errorMessage":"Failed to install Snowflake dependencies","messagePattern":"Failed to install Snowflake dependencies","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py","lineNumber":153,"sourceCode":"                import subprocess\n\n                try:\n                    subprocess.run(\n                        [  # noqa: S607\n                            \"uv\",\n                            \"add\",\n                            \"cryptography\",\n                            \"snowflake-connector-python\",\n                            \"snowflake-sqlalchemy\",\n                        ],\n                        check=True,\n                    )\n\n                    self._connection_pool = []\n                    self._pool_lock = threading.Lock()\n                    self._thread_pool = ThreadPoolExecutor(max_workers=self.pool_size)\n                except subprocess.CalledProcessError as e:\n                    raise ImportError(\"Failed to install Snowflake dependencies\") from e\n            else:\n                raise ImportError(\n                    \"Snowflake dependencies not found. Please install them by running \"\n                    \"`uv add cryptography snowflake-connector-python snowflake-sqlalchemy`\"\n                ) from None\n\n    async def _get_connection(self) -> SnowflakeConnection:\n        \"\"\"Get a connection from the pool or create a new one.\"\"\"\n        if self._pool_lock is None:\n            raise RuntimeError(\"Pool lock not initialized\")\n        if self._connection_pool is None:\n            raise RuntimeError(\"Connection pool not initialized\")\n        with self._pool_lock:\n            if self._connection_pool:\n                return self._connection_pool.pop()\n        return await asyncio.get_event_loop().run_in_executor(\n            self._thread_pool, self._create_connection\n        )","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py#L135-L171","documentation":"SnowflakeSearchTool, like other crewai-tools, offers to install missing dependencies interactively (cryptography, snowflake-connector-python, snowflake-sqlalchemy) via `uv add`. This ImportError is raised when that subprocess fails (CalledProcessError chained via `from e`) — the install was attempted but the package manager returned non-zero.","triggerScenarios":"Instantiating SnowflakeSearchTool without the Snowflake packages, confirming the click.prompt, while `uv` is unavailable/not on PATH, the directory is not a uv project, there is no network, or dependency resolution conflicts block the install.","commonSituations":"pip/conda environments without uv; CI containers lacking uv; Python version incompatibilities with snowflake-connector-python; offline or proxy-restricted networks.","solutions":["Install the dependencies directly: uv add cryptography snowflake-connector-python snowflake-sqlalchemy (or pip install snowflake-connector-python snowflake-sqlalchemy cryptography).","Inspect the chained CalledProcessError output for the underlying cause (missing uv, resolver conflict, network failure) and fix that.","Pin compatible versions if snowflake-connector-python cannot resolve for your Python version."],"exampleFix":"# terminal\n# before: tool instantiation triggers failed auto-install\n\n# after:\n#   pip install snowflake-connector-python snowflake-sqlalchemy cryptography\n# then instantiate the tool","handlingStrategy":"try-catch","validationCode":"import importlib.util\nmissing = [m for m in (\"snowflake\", \"snowflake.sqlalchemy\", \"cryptography\") if importlib.util.find_spec(m) is None]\nif missing:\n    raise RuntimeError(f\"Missing Snowflake deps {missing}; run: pip install snowflake-connector-python snowflake-sqlalchemy cryptography\")","typeGuard":null,"tryCatchPattern":"try:\n    tool = SnowflakeSearchTool(config=cfg)\nexcept ImportError as e:\n    raise RuntimeError(f\"Install Snowflake deps before startup: {e}\") from e","preventionTips":["Install Snowflake dependencies as an explicit build step; never rely on runtime auto-install in production.","Gate startup on importlib checks for optional heavy dependencies."],"tags":["snowflake","dependency","installation","uv"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}