Installing the uAgents Framework
System Requirements
Fetch.ai’s uagents Frameworks package is a Python library running on Ubuntu/Debian, MacOS, and Windows systems.
On your computer, you may need to install:
- Python
3.8+.
- PIP
- the Python package manager.
- uAgents library
Install with Pip
-
Create a directory for your agents project:
mkdir directory_name
-
Install Fetch.ai
uagents
library:pip install uagents
-
Check if installation was successful:
pip show uagents
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.
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 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
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. Let’s then ensure Homebrew is updated:
brew update
For more information on Homebrew explore their website.
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.
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