2. Setup Your Environment
2. Setup Your Environment
Section titled “2. Setup Your Environment”Prerequisites
Section titled “Prerequisites”- Python 3.10 or higher.
- Access to a terminal or command prompt.
- Git, for cloning the repository.
- A code editor (e.g., Visual Studio Code) is recommended.
Clone the Repository
Section titled “Clone the Repository”If you haven’t already, clone the A2A Samples repository:
git clone https://github.com/a2aproject/a2a-samples.git -b main --depth 1cd a2a-samplesPython Environment & SDK Installation
Section titled “Python Environment & SDK Installation”We recommend using a virtual environment for Python projects. The A2A Python SDK uses uv for dependency management, but you can use pip with venv as well.
-
Create and activate a virtual environment:
Using
venv(standard library):=== “Mac/Linux”
```shpython -m venv .venvsource .venv/bin/activate```=== “Windows”
```powershellpython -m venv .venv.venv\Scripts\activate``` -
Install needed Python dependencies along with the A2A SDK and its dependencies:
Terminal window pip install -r samples/python/requirements.txt
Verify Installation
Section titled “Verify Installation”After installation, you should be able to import the a2a package in a Python interpreter:
python -c "import a2a; print('A2A SDK imported successfully')"If this command runs without error and prints the success message, your environment is set up correctly.