Skip to content

Lesson 1: Setting up your environment

By the end of this lesson:

You will know how to set up an environment to use and develop agents.

System requirements

The AEA framework can be used on Windows, Ubuntu/Debian and MacOS.

You need Python 3.8 or higher on your system.

Setup

Step 1

Create a new working directory. Let's call it my_aea_projects. This is where you will create your agent projects. Enter my_aea_projects.

Step 2

Add an empty directory called packages. This is a local registry* for your agents' components.

* You will learn more about this in the next unit.

Run the following command to create the directory structure:
mkdir my_aea_projects/ && cd my_aea_projects/ && mkdir packages
md my_aea_projects/ && cd my_aea_projects/ && md packages

You should now have the following directory structure:

my_aea_projects
└── packages

Virtual Environment (optional)

We highly recommend using a virtual environment so that your setup is isolated from the rest of your system. This prevents clashes and ensures consistency across dependencies.

You can use any common virtual environment manager for Python. In this lesson, we will cover pipenv and poetry. If you do not have either, install one.

To check if you have pipenv installed ...
which pipenv
where pipenv
To check if you have poetry installed ...
which poetry
where poetry

Step 3

Create a new pipenv environment in the my_aea_projects directory and enter it (you can use Python version 3.8, 3.9, or 3.10 in the command):

pipenv --python 3.9 && pipenv shell

Create a new poetry environment in the my_aea_projects directory and enter it:

poetry init -n && poetry shell

To exit a virtual environment:

Press Ctrl + D. Try existing the environment and entering again via pipenv shell or poetry shell.

Installation

Step 4

Install the AEA framework:

pip install aea[all]
pip install 'aea[all]'

Initialisation

By initialising the AEA framework, you will pick an author handle which will be used in any agent or agent component you create.

Step 5

Initialise the AEA framework using the init command:

aea init
aea init fetchai
    _     _____     _
   / \   | ____|   / \
  / _ \  |  _|    / _ \
 / ___ \ | |___  / ___ \
/_/   \_\|_____|/_/   \_\

v1.2.3

AEA configurations successfully initialized: {'author': 'fetchai'}