Installing the uAgents Framework
System Requirements
Fetch.ai's uagents (opens in a new tab) Frameworks package is a Python library running on Ubuntu/Debian, MacOS, and Windows systems.
On your computer, you may need to install:
- Python (opens in a new tab)
3.8+.
- PIP (opens in a new tab)
- the Python package manager.
- Poetry (opens in a new tab)
for virtual environments (optional).
- uagents library (opens in a new tab)
Install with Pip
-
Create a directory for your agents project:
mkdir directory_name
-
Within the directory, create and open a virtual environment using Poetry:
poetry init -n && poetry shell
-
Install Fetch.ai
uagents
library:pip install uagents
-
Check if installation was successful:
pip show uagents
If you want to install a specific version of the uagents
library (e.g., 0.12.0), you can do so by running the following:
pip install uagents==0.12.0
Current version of the uAgents package is .
Install from source code
-
Download the latest released version from Github and navigate to the agents directory:
git clone https://github.com/fetchai/uAgents.git cd uAgents
-
Install the required dependencies:
poetry install
-
Open the virtual environment:
poetry shell
Troubleshooting
It is possible that you may face issues during the installation process. Here, you can find common problems and their solutions.
Problem (MacOS/Python 3.11): Installing coincurve (17.0.0): Failed
Solution: install the latest versions of automake
, autoconf
, and libtool
: brew install automake autoconf libtool
For any other problems, please let us know by creating an issue (opens in a new tab).
Simplified Installation for Windows users
Installing the uagents framework on a Windows machine is a straightforward process. The uagents
library is a Python package, so you'll need to have Python installed on your system before you can use it.
If you don't already have Python installed on your Windows machine, visit the official Python website at Python (opens in a new tab) and download the latest stable version of Python for Windows.
Run the downloaded installer executable file (e.g., python-3.x.x.exe).
During installation, make sure to check the box that says "Add Python X.X to PATH." This will automatically add Python to your system's PATH variable, making it easier to use from the command line.
Install uagents library using pip
Once you have Python installed and added to your PATH, follow these steps to install the uagents framework using pip:
-
To install using PIP open your terminal. To ensure that PIP (Python's package manager) is up-to-date, run the following command:
python -m pip install --upgrade pip
-
Now, you can install the
uagents
framework by running the following command:pip install uagents
PIP will download and install the uagents
package and its dependencies. Wait for the process to complete. To verify the complete installation explore your terminal. As part of the installation you will see a message showcasing the completion of the installation as well as the exact version.
Installing other essential python libraries
Installing AI Engine library
If you wish to create AI Engine compatible Agents, you will need to get the
uagents-ai-engine
package installed. Checkout the AI Engine package (opens in a new tab) to download it and start developing your AI Engine compatible Agents.
You can install AI Engine with pip: pip install uagents-ai-engine
Explore the additional resources we have on AI Engine compatible Agents:
Current version of the package AI Engine is .
Development tools
Installing Homebrew
Homebrew streamlines software installations on MacOS via the command line. To install and update Homebrew, execute the following commands:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You can verify it here (opens in a new tab). Let's then ensure Homebrew is updated:
brew update
For more information on Homebrew explore their website (opens in a new tab).
Installing PyEnv
Now, you need to install PyEnv. It is a simple tool to manage multiple versions of Python. Run:
brew install pyenv
Once you have installed PyEnv you can configure the shell environment:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
These commands configure your shell environment (specifically the Zsh shell) to work with PyEnv. These commands set up environment variables, modify the PATH, and initialize PyEnv so that you can easily manage and switch between different Python versions. You can verify all steps here (opens in a new tab).
You are now ready to install Python if you haven't done it yet. You need to install a version of Python 3.8 or above (for this example, we use version 3.10):
pyenv install 3.10
You can get help or check a command insights by running:
pyenv help
Let's now ensure the global version of Python you are working with is not the default one in the system. Run:
pyenv global 3.10 # this sets the global interpreter
pyenv versions # this verifies if it is set up correctly
Installing Poetry
You now need to install Poetry. Poetry is used for managing Python project dependencies, handling virtual environments, packaging, and publishing Python libraries or applications.
You can install Poetry by running the following command:
curl -sSL https://install.python-poetry.org | python3 -
If you would like to learn more about Poetry, visit the website (opens in a new tab) for further information.
Initialize your project with Poetry
You now have all necessary tools installed. You are ready to initialize your project! Let's create a working directory and initialize Poetry 🎉.
First, you need to create a working directory for your project using mkdir
command. Then, you will need to change directory to this one, using cd
command:
mkdir development/agent-demo
cd development/agent-demo
You can ensure you are in the correct directory by checking your current path:
pwd
# Example output: /Users/Jessica/Documents
If you are happy with the install location for the project, go ahead and initialize Poetry:
poetry init
Follow the setup wizard to provide details including project name, version, author, license, and select dependencies (e.g., uagents
).
Once you complete the initialization, run:
poetry install
This command will install the dependencies specified in the pyproject.toml file.