{"record":{"id":"de0d5c20774c59d7","repo":"crewAIInc/crewAI","slug":"snowflake-dependencies-not-found-please-install-t","errorCode":null,"errorMessage":"Snowflake dependencies not found. Please install them by running `uv add cryptography snowflake-connector-python snowflake-sqlalchemy`","messagePattern":"Snowflake dependencies not found\\. Please install them by running `uv add cryptography snowflake-connector-python snowflake-sqlalchemy`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py","lineNumber":155,"sourceCode":"                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        )\n\n    def _create_connection(self) -> SnowflakeConnection:","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py#L137-L173","documentation":"SnowflakeSearchTool raises this ImportError when the Snowflake packages (cryptography, snowflake-connector-python, snowflake-sqlalchemy) are missing and the user declines the interactive install prompt. It is the explicit opt-out branch and includes the exact install command in the message.","triggerScenarios":"Importing/instantiating SnowflakeSearchTool in an environment without the Snowflake deps and answering 'no' to the click.confirm prompt; or non-interactive shells where confirm defaults to declining.","commonSituations":"CI/CD and Docker runs where the prompt cannot be answered; users on pip-only projects who decline a uv-based install; slim images without optional extras installed.","solutions":["Install the extras yourself: uv add cryptography snowflake-connector-python snowflake-sqlalchemy, or pip install the same packages.","Add the packages to your requirements/Dockerfile so instantiation never reaches the prompt.","For automated environments, pre-install dependencies — the prompt only appears on ImportError."],"exampleFix":"Dockerfile:\n# before\nRUN pip install crewai-tools\n\n# after\nRUN pip install crewai-tools snowflake-connector-python snowflake-sqlalchemy cryptography","handlingStrategy":"validation","validationCode":"import importlib.util\nfor mod in (\"snowflake\", \"snowflake.sqlalchemy\", \"cryptography\"):\n    if importlib.util.find_spec(mod) is None:\n        import subprocess\n        subprocess.run([\"pip\", \"install\", mod.replace(\"sqlalchemy\", \"connector-python\")], check=True)","typeGuard":null,"tryCatchPattern":"try:\n    tool = SnowflakeSearchTool(config=cfg)\nexcept ImportError as e:\n    if \"Snowflake dependencies not found\" in str(e):\n        subprocess.run([\"pip\", \"install\", \"snowflake-connector-python\", \"snowflake-sqlalchemy\", \"cryptography\"], check=True)\n        tool = SnowflakeSearchTool(config=cfg)","preventionTips":["Add snowflake-connector-python, snowflake-sqlalchemy, and cryptography to requirements/Dockerfile.","Run with dependencies pre-installed in CI so interactive prompts cannot appear."],"tags":["snowflake","dependency","installation","opt-out"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}