AI

Installing Rasa in Windows and Linux (Ubuntu)

February 21, 2023
3 min
By
Udara
Share

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.

Command to check the python version

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

Command to check the pip version

or

Another command to check the pip version

Create a new virtual environment for rasa.

Command to create virtual environment in windows

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

Command to upgrade pip in windows

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

Command to install RASA in windows

Use the following command to check if Rasa is installed correctly

Command to check rasa version in windows

Ubuntu (Linux)

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

Command to check the python version and pip version

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

command to install python in ubuntu

Create a new virtual environment for Rasa and activate it.

command to create new virtual environment and activate in ubuntu

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

Upgrade your pip to the latest version

Command to upgrade pip in ubuntu

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

Command to install RASA in ubuntu

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

Command to check the RASA version in ubuntu

Congratulations! Now you have successfully installed Rasa.

Creating a New Project

The virtual environment should be activated before running Rasa.

Windows — in command prompt

Command to activate virtual environment in windows

Ubuntu — in terminal

Command to activate virtual environment in ubuntu

To create a new project, run:

Command to create new project

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

Steps after init command

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

Command to run bot manually

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

Running bot

Congratulations! You have created your first Rasa project.

More