Installation

Based on the official Installation guide (treat that page as source of truth). CrewAI uses uv for the CLI and project deps; the library also installs with pip install crewai.


Requirements

  • Python >=3.10 and <3.14
  • uv (official) or pip
  • At least one LLM provider API key
python3 --version

Coding-agent skills (optional)

In Cursor, Claude Code, Codex, and similar:

npx skills add crewaiinc/skills

If npx is missing, skip this and use docs.crewai.com plus llms.txt.


Official path: uv and the CLI

macOS / Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Install the global CLI:

uv tool install crewai
uv tool update-shell   # if PATH warning
uv tool list           # should list crewai
crewai version
crewai create --help

Upgrade the CLI with uv tool install crewai --upgrade. That upgrades the global tool only; project venv upgrades are documented under “Upgrading CrewAI in a project”.

Windows chroma-hnswlib / missing float.h: install Visual Studio Build Tools with Desktop development with C++.


Alternative: pip

python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS / Linux: source .venv/bin/activate
pip install -U crewai
pip install 'crewai[tools]'   # crewai_tools: Serper, files, RAG helpers, …
python -c "from crewai import Agent, Task, Crew; print('ok')"

In a uv project: uv add crewai or uv add 'crewai[tools]'. Some providers have extras such as uv add "crewai[openai]". Other LiteLLM-backed providers: uv add 'crewai[litellm]' — see LLMs.


API keys

Never hardcode secrets. Use .env (gitignored).

OPENAI_API_KEY=sk-...
MODEL=openai/gpt-4o-mini
SERPER_API_KEY=...
from dotenv import load_dotenv
load_dotenv()

Model IDs are provider/model-id (e.g. openai/gpt-4o-mini, anthropic/claude-sonnet-4-6). Or from crewai import LLMLLM(model="openai/gpt-4o-mini").


Create a project

JSON-first Crew (current default):

crewai create crew my_research_crew
cd my_research_crew
crewai install
crewai run

Agents live in agents/*.jsonc; tasks, process, and default inputs live in crew.jsonc. {placeholder} values are filled from inputs or CLI prompts.

Classic Python / YAML (crew.py + config/agents.yaml):

crewai create crew my_research_crew --classic

Flow project (the official Quickstart’s production entry):

crewai create flow latest-ai-flow
cd latest_ai_flow
crewai install
crewai run

Add packages with uv add <package-name>. CrewAI internal packages may set exclude-newer; your direct dependencies are unaffected.


Enterprise (awareness)

  • CrewAI AMP (SaaS) — hosted console, including no-code crews
  • CrewAI Factory — self-hosted containers

This tutorial stays on the local SDK / CLI.


Troubleshooting

crewai not found? uv tool update-shell and open a new terminal.

Python 3.14? Official requirement is currently <3.14; use 3.12 or 3.13.

Scripts only, no scaffold? pip install crewai then from crewai import Agent, Task, Crew — see Quick Start.


Next steps

评论