Installing Rasa in Linux (Ubuntu)and Windows

Jagadish Hiremath
3 min readOct 29, 2020
Rasa

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 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 the 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 .

python --version

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

pip --version

or

python -m pip --version

Create a new virtual environment for rasa.

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

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

Upgrade your pip to the latest version

pip install -U pip

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

pip install rasa

Use the following command to check if Rasa is installed correctly

rasa --version

Ubuntu (Linux)

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

python3 --versionpython3 -m pip --version

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

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.

python3 -m venv ./venvsource 
./venv/bin/activate

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

Upgrade your pip to the latest version

pip install -U pip

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

pip install rasa

Use the following command to check if Rasa is installed correctly

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

.\venv\Scripts\activate

Ubuntu — in terminal

source ./venv/bin/activate

To create a new project, run:

rasa init

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

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

rasa shell

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

Congratulations! You have created your first Rasa project.

--

--