Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aissam-en/f2a58826578d1b337f2bc0359619a10a to your computer and use it in GitHub Desktop.
Save aissam-en/f2a58826578d1b337f2bc0359619a10a to your computer and use it in GitHub Desktop.
Rasa 3.6.16 Installation on Ubuntu 24.04 with Python 3.10

1. Install Python 3.10 using Deadsnakes PPA

Ubuntu 24.04 comes with a newer Python version. But Rasa 3.6 only works with Python 3.8 to 3.10 Rasa Docs.

So we’ll install Python 3.10 from a trusted source called Deadsnakes :

# Update the system
sudo apt update && sudo apt upgrade -y

# Install software that allows adding repositories
sudo apt install -y software-properties-common

# Add the Deadsnakes PPA, source for old Python versions
sudo add-apt-repository ppa:deadsnakes/ppa -y

# Install Python 3.10
sudo apt install -y python3.10 python3.10-venv python3.10-dev

# Check the installed version
python3.10 --version

2. Create a Virtual Environment

A virtual environment is like a clean space to install Rasa without affecting the ubuntu system :

# Navigate to the folder where we want to install the bot
cd ~

# Create a project folder
mkdir rasa-bot && cd rasa-bot

# Create the virtual environment
python3.10 -m venv venv

# Activate the virtual environment
source venv/bin/activate

If successful, the terminal prompt should now start with (venv).

3. Install Rasa 3.6.16

Now that we are inside the virtual environment, we will install Rasa :

pip install --upgrade pip
pip install rasa==3.6.16
rasa --version

4. Create a New Rasa Project

rasa init

You’ll be asked :

"Do you want to train an initial model?"
Type y and press Enter.

It will generate a sample chatbot project with folders like :

  • data/ : where training examples are stored
  • domain.yml : the brain of the chatbot (intents, actions, responses)
  • config.yml : configuration settings for training
  • actions/ : for custom Python code

5. Run and Talk to The Bot

Now we can talk to the bot:

rasa shell

Type messages like:

hello
what can you do?
bye

6. To Stop and Exit

Type /stop in rasa shell, and to exit the virtual environment type:

deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment