How to Install Dependencies for Hello-Agents: A Complete Setup Guide
Install dependencies for hello-agents by cloning the repository, creating a Python virtual environment, and running pip install -r requirements.txt in the specific chapter directory you want to run.
The datawhalechina/hello-agents repository provides a comprehensive tutorial series on building AI agents, with executable examples organized under the code/ directory. Each chapter maintains its own isolated dependency requirements, while supplementary tooling for Node.js and n8n workflows resides in the Additional-Chapter/ folder.
Standard Python Environment Setup
The repository follows a consistent pattern across all Python examples. According to the root README.md, the standard workflow uses virtual environments and pip requirements files to manage dependencies.
Step 1: Clone and Prepare
Start by cloning the repository and entering the directory:
git clone https://github.com/datawhalechina/hello-agents.git
cd hello-agents
Step 2: Create a Virtual Environment
Create and activate a Python virtual environment to isolate dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Step 3: Install Chapter-Specific Dependencies
Navigate to your target example and install its unique requirements. For instance, to run the AutoGen demo in Chapter 6:
cd code/chapter6/AutoGenDemo
pip install -r requirements.txt
The file code/chapter6/AutoGenDemo/requirements.txt contains packages like LangGraph and the OpenAI SDK specific to that demonstration. Each chapter's README.md (such as code/chapter6/AutoGenDemo/README.md) confirms this installation command and provides the entry point command, typically python main.py.
Installing Non-Python Dependencies
Some examples require Node.js runtime or n8n workflow engines rather than Python packages.
Node.js Setup
For chapters utilizing Node.js tools, refer to Additional-Chapter/NODEJS_INSTALL_GUIDE.md. This document provides platform-specific commands for installing Node.js and npm packages required by certain low-code platform examples.
n8n Workflow Engine
To run n8n-based workflows, consult Additional-Chapter/N8N_INSTALL_GUIDE.md. This guide contains Docker Compose configurations to spin up the n8n service:
cd Additional-Chapter
docker compose -f N8N_INSTALL_GUIDE.yml up -d
Docker-Based Installations
Some services specify container-based dependency management. The weather MCP server in Chapter 10 (code/chapter10/weather-mcp-server/) demonstrates this pattern in its requirements.txt and accompanying Dockerfile, using pip install --no-cache-dir -r requirements.txt within container builds rather than on the host system.
Verification and Execution
After installation, verify your environment by running the example's entry point. For the AutoGen demo:
python main.py
Each chapter's README specifies the exact execution command and expected output for that specific example.
Summary
- Clone the datawhalechina/hello-agents repository and use Python virtual environments to isolate dependencies.
- Run
pip install -r requirements.txtwithin individual chapter directories undercode/(e.g.,code/chapter6/AutoGenDemo/). - Consult
Additional-Chapter/NODEJS_INSTALL_GUIDE.mdfor Node.js dependencies andAdditional-Chapter/N8N_INSTALL_GUIDE.mdfor Docker-based n8n setup. - Some services like the Chapter 10 weather MCP server use Docker with
pip install --no-cache-dirpatterns rather than local installation.
Frequently Asked Questions
Do I need to install all dependencies at once?
No. The repository structure isolates dependencies by chapter. Install only the requirements.txt located in the specific chapter directory you intend to run, such as code/chapter6/AutoGenDemo/requirements.txt for the AutoGen examples. This prevents version conflicts between different chapters.
What if I need to run examples from multiple chapters?
Create separate virtual environments for each chapter, or deactivate and reactivate your environment when switching between chapters to avoid package conflicts. Each chapter's requirements.txt may specify different versions of the same library, making isolation essential.
How do I install dependencies for the n8n workflow examples?
Navigate to the Additional-Chapter/ directory and follow the Docker Compose instructions in Additional-Chapter/N8N_INSTALL_GUIDE.md. These examples do not use Python pip; they require Docker to run the n8n workflow engine and associated services.
Is there a global requirements file in the repository root?
No. While the root README.md references the general pattern of pip install -r requirements.txt, actual dependency specifications reside in chapter-specific subdirectories. Always check the relevant code/ subdirectory for that chapter's specific requirements file.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →