Installing Rasa in Windows and Linux (Ubuntu)


Conversational AI is gaining popularity over the past few years, where all the popular websites are now being included with a Chatbot. Creating an AI assisted chatbot is getting simpler now, so that a person with less or no knowledge about Machine Learning and Natural Language Processing can build their own chatbot from scratch with a basic programming knowledge.

Visit Rasa documentation for a detailed explanation.


Rasa Installation

Rasa is based on Python and installed using python package installer (pip). It is highly recommended to create a virtual environment before installing Rasa.


Windows

First download and install Microsoft Visual C++Build Tools

Check whether your system has already installed Python 3.7 using following commands in the command prompt. If not, install Python 3 here and make sure you tick the option Add to PATH variable in the installer. If you have installed both Python 2 and Python 3, python3 should be used instead of python.

1
python --version

Check whether you have installed pip3 using the following commands. If not, install pip here.

1
pip --version

or

1
python -m pip --version

Create a new virtual environment for rasa.

1
2
python -m venv --system-site-packages ./venv
.\venv\Scripts\activate

Your command prompt should look like following if the virtual environment is properly activated.
(venv) C:\Users\user

Upgrade your pip to the latest version

1
pip install -U pip

Install Rasa on the virtual environment . This may take several minutes.

1
pip install rasa

Use the following command to check if Rasa is installed correctly

1
rasa --version

Ubuntu (Linux)

Run the following command in terminal to see if python 3.7 and pip are already available.

1
2
3
python3 --version

python3 -m pip --version

If python 3.7 is not installed, install it using following commands.

1
2
3
4
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7

Create a new virtual environment for Rasa and activate it.

1
2
python3 -m venv ./venv
source ./venv/bin/activate

Your command prompt should look like following if the virtual environment is properly activated.
(venv)/root/>

Upgrade your pip to the latest version

1
pip install -U pip

Install Rasa on the virtual environment. This may take several minutes.

1
pip install rasa

Use the following command to check if Rasa is installed correctly.

1
rasa --version

Congratulations! Now you have successfully installed Rasa.

Creating a New Project

The virtual environment should be activated before running Rasa.

Windows — in command prompt

1
.\venv\Scripts\activate

Ubuntu — in terminal

1
source ./venv/bin/activate

To create a new project, run:

1
rasa init

Select an installation path and train the initial model. This will take several minutes depending on the system hardware.

rasa init console output

Once the training has been finished, the bot will be loaded automatically. To run the bot manually, navigate to the created folder and type:

1
rasa shell

You can type a message and see how the bot responds.

rasa shell output

Congratulations! You have created your first Rasa project.