crewAIInc/crewAI · error · ImportError
Snowflake dependencies not found. Please install them by run
Error message
Snowflake dependencies not found. Please install them by running `uv add cryptography snowflake-connector-python snowflake-sqlalchemy`
What it means
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.
Source
Thrown at lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py:155
try:
subprocess.run(
[ # noqa: S607
"uv",
"add",
"cryptography",
"snowflake-connector-python",
"snowflake-sqlalchemy",
],
check=True,
)
self._connection_pool = []
self._pool_lock = threading.Lock()
self._thread_pool = ThreadPoolExecutor(max_workers=self.pool_size)
except subprocess.CalledProcessError as e:
raise ImportError("Failed to install Snowflake dependencies") from e
else:
raise ImportError(
"Snowflake dependencies not found. Please install them by running "
"`uv add cryptography snowflake-connector-python snowflake-sqlalchemy`"
) from None
async def _get_connection(self) -> SnowflakeConnection:
"""Get a connection from the pool or create a new one."""
if self._pool_lock is None:
raise RuntimeError("Pool lock not initialized")
if self._connection_pool is None:
raise RuntimeError("Connection pool not initialized")
with self._pool_lock:
if self._connection_pool:
return self._connection_pool.pop()
return await asyncio.get_event_loop().run_in_executor(
self._thread_pool, self._create_connection
)
def _create_connection(self) -> SnowflakeConnection:View on GitHub (pinned to 754d7323be)
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.
Example fix
Dockerfile: # before RUN pip install crewai-tools # after RUN pip install crewai-tools snowflake-connector-python snowflake-sqlalchemy cryptography
Defensive patterns
Strategy: validation
Validate before calling
import importlib.util
for mod in ("snowflake", "snowflake.sqlalchemy", "cryptography"):
if importlib.util.find_spec(mod) is None:
import subprocess
subprocess.run(["pip", "install", mod.replace("sqlalchemy", "connector-python")], check=True) Try / catch
try:
tool = SnowflakeSearchTool(config=cfg)
except ImportError as e:
if "Snowflake dependencies not found" in str(e):
subprocess.run(["pip", "install", "snowflake-connector-python", "snowflake-sqlalchemy", "cryptography"], check=True)
tool = SnowflakeSearchTool(config=cfg) Prevention
- Add snowflake-connector-python, snowflake-sqlalchemy, and cryptography to requirements/Dockerfile.
- Run with dependencies pre-installed in CI so interactive prompts cannot appear.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- `singlestore` package not found, please run `uv add crewai-t
- Failed to install Snowflake dependencies
- `spider-client` package not found, please run `uv add spider
- The 'e2b' package is required for E2B sandbox tools. Install
- `scrapfly-sdk` package not found, please run `uv add scrapfl
AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15).
Data as JSON: /api/errors/de0d5c20774c59d7.
Report an issue: GitHub.