Running RASA on the RPi 4 with Raspbian Buster!

Hello RASA Community!

It is with great pleasure that I can share the results of hard-work spearheaded by @JulianGerhard and myself about how to install and run RASA on the RPi 4 having Raspbian Buster installed on the computer!

Please keep in mind, these instructions may still have issues - please post if you find anything wrong with it. :smiley:

Here are the instructions

  1. First, prepare a fresh installation of Raspbian Buster (Lite) on your Pi.
  2. Copy the following script into a file called
# Update the Raspberry Pi
sudo apt-get update
sudo apt-get upgrade -y 
sudo apt-get dist-upgrade -y

# Install initial build dependencies
# Provides 
# Enables pip3.6 to access pypi
sudo apt-get install libbz2-dev libssl-dev -y 

# Get and install Python3.6
tar -xvf Python-3.6.8.tar.xz
cd Python-3.6.8
sudo ./configure
sudo make -j4
sudo make install

# Update Python3.6 packages
python3.6 -m pip install --upgrade pip setuptools --user

# Install additional dependencies
# Enables access to Tensorflow whl
# Dependency for the h5py python package
sudo apt-get install python3-pip libhdf5-dev -y

# Install Tensorflow
python3.6 -m pip install tensorflow==1.14.0 --user

# Install OpenCV Dependencies
sudo apt-get install build-essential cmake unzip pkg-config -y
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install libgtk-3-dev -y
sudo apt-get install libcanberra-gtk* -y
sudo apt-get install libatlas-base-dev gfortran -y
sudo apt-get install python3-dev -y

# Download OpenCV and clarify naming scheme
cd ~
wget -O
wget -O
mv opencv-4.0.0 opencv
mv opencv_contrib-4.0.0 opencv_contrib

cd ~/opencv
mkdir build
cd build

    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \

# Increasing swap size to make OpenCV
sed -i "s/^CONF_SWAPSIZE.*/CONF_SWAPSIZE=${SWAPSIZE}/" /etc/dphys-swapfile

# Restarting swap service
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start

# Make OpenCV
make -j4

# Install OpenCV
sudo make install
sudo ldconfig

# Reseting swap size
sed -i "s/^CONF_SWAPSIZE.*/CONF_SWAPSIZE=${SWAPSIZE}/" /etc/dphys-swapfile

# Restarting swap service
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start

# Link cv2 to Python3.6
cd /usr/local/lib/python3.6/site-packages/
sudo ln -s /usr/local/python/cv2/python-3.6/

# In case git is not installed
sudo apt-get install git -y

# Getting codebases for spaCy, tensor2tensor, and RASA
# NOTE: This is hard-coded for rasa-1.4.0 right now - let's make it more elegant soon
cd ~
git clone
git clone
git clone
wget && unzip 

# Installing spaCy
export BLIS_ARCH=generic
cd ~/spaCy
python3.6 -m pip install -r requirements.txt --user
python3.6 build_ext --inplace
python3.6 -m pip install . --user

# Installing dopamine-rl
cd ~/dopamine
sed -i '/opencv-python/d'
python3.6 -m pip install . --user

# Installing tensor2tensor
cd ~/tensor2tensor
sed -i '/opencv-python/d'
sed -i '/dopamine-rl/d'
python3.6 -m pip install . --user --force-reinstall

# Installing other RASA dependencies
sudo apt install libpq-dev/buster -y 
python3.6 -m pip install psycopg2 --user

# Installing RASA
cd ~/rasa-1.4.0
sed -i '/tensor2tensor/d'
sed -i '/tensor2tensor/d' requirements.txt
python3.6 -m pip install -r requirements.txt --user --force-reinstall
python3.6 -m pip install . --user --force-reinstall

# Script exit
echo ""
echo ""
echo "------------------------------------------------------------"
echo "Congratulations! Rasa is now installed on your Raspberry Pi."
echo "To test rasa out, run python3.6 -m rasa init and start "
echo "creating your bot!"
  1. Execute the following: sudo chmod +x on the Raspberry Pi
  2. Execute the following: ./ on the RPi. Please note that installation will take a very long time (~3 hours or so). Grab a tea (I recommend a London Fog), go for a run, read a book and come back later!
  3. You will have some folders and files leftover in your home directory so feel free to delete those now that everything is installed.


I would certainly like to thank @JulianGerhard21 for all the fantastic assistance, input, and massively heavy lifting. Without Julian’s input, none of this would be possible. I have had a wonderful time working together here and learned a lot from you and this process - a “thank you” cannot do you enough justice but… THANK YOU

I would also like to thank @jrosebr for his awesome instructions that I adapted here for installing OpenCV.

Finally, a huge thank you to the RASA team (@Tobias_Wochinger and @akelad). Thank you for making this wonderful product and I am excited to see how we can all use it on resource-constrained devices!


Thanks for all your work @TheCedarPrince @JulianGerhard,

Unfortunately I didn’t have the chance to test it out myself because I don’t own a raspberry pi 4. Did anybody have a chance to do so? Would love to hear your feedback!

Continuing the discussion from Running RASA on the RPi 4 with Raspbian Buster!:

hello,why? Have a error,“pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available” when i run python3.6 -m pip install --upgrade pip setuptools --user, thanks

@1535966643 Did you run this command sudo apt-get install libbz2-dev libssl-dev -y before you tried installing the setuptools?



  • Traceback of your error
  • Where exactly the script failed
  • The output of python3.6 -m pip freeze

I do not have the time to parse the error without this information - this will help me get to the error as fast as possible.

Thank You!

~ TheCedarPrince

I had to remove dopamine from the tensor2tensor file as suggested in the github issue.

I’ve posted a modified install script as a gist and I now have Rasa running on a Raspberry Pi 4!


Awesome @stephens! Glad this could help you out! I will modify the main script here for future users. Have fun with the RasaPi!

Hello @TheCedarPrince,

I found this to be very interesting. But since i’m kinda a noob, i don’t really understand what it means to be able to run Rasa on RPi. Does it mean that i can run a model on RPi ? Can i run the Rasa server in RPi too ? For example if i have a voice recognition module interface with the RPi, i can extract the text, send that message to a Rasa server running in RPi and predict intents, etc… such as ‘turn off the light’ and control the peripheral PINs correspondingly ?

Hey @fuih,

That is exactly what it means - you should be able to run a server on the RPi. I have been able to successfully train and create a model on the RPi.

It sounds like you are working on an end2end personal assistant project - you can think of RASA in this case acting as the brain for your system. And it can do that. The whole reason why I decided to work with RASA was that I saw it had the flexibility to do all this.

If you are curious, here was the criterion I used to assess RASA:


And believe it or not, RASA checked off everything on this list.

Now, I think all the rest you have to do @fuih is to let your imagination run wild and see what you can do. :smiley: If you need any help getting this running on your RPi, we are here to support you!

Good luck making your RasaPi!

Yours, TheCedarPrince

1 Like

你好,我确实这样运行了,但还是不行(要奔溃了)。我的树莓派是4B,python系统为2.7和3.7,我想知道我能不能在3.7上安装,因为安装py3.6一直有问题,还有对rasa的版本有什么要求吗?(前面我安装,rasa在rasa init时候发生错误)


Hey @1535966643,

I am using a translator - I am using simple words in English.

The tutorial was not made for Python 3.7. I cannot provide help there.

It is a good question to ask on the forum. I suggest making another post and ask about how to use python3.7 with the raspberry pi.

Thank you @TheCedarPrince, this is very awesome. Is there any hardware requirement of the RPi4 that we have to meet ? From what i see RPi4 can come with 1,2 or 4GB RAM, which one should be enough to run Rasa normally ?

Great question! I highly suggest the RPi4 with 4GB of RAM. I have not tested it otherwise and I do not know if it would work with less RAM.

Thank you @TheCedarPrince for the install-script. I’ve installed it in 32bit-mode on Rasbian (Buster) to the Pi4 with 4gb, After that, i saw that the Editor “Visual Studio Code” needs an 64bit-System to install. Is it enough to set the bootmode in raspbian to 64bit after the installation, or do I have to restart the installation?

Then i installed RASA X with some Errormassages …

pi@pi4:~ $ pip install rasa-x --extra-index-url Looking in indexes:,, Collecting rasa-x Downloading (1.6MB) |████████████████████████████████| 1.6MB 1.7MB/s Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … done Collecting rasa~=1.4.0 Downloading (518kB) |████████████████████████████████| 522kB 1.5MB/s Collecting aiohttp~=3.5 Downloading (441kB) |████████████████████████████████| 450kB 7.3MB/s Collecting sanic-cors==0.9.9.post1 Downloading Collecting cryptography~=2.7 Downloading (504kB) |████████████████████████████████| 512kB 9.7MB/s Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … done Requirement already satisfied: attrs>=18 in ./.local/lib/python3.6/site-packages (from rasa-x) (19.3.0) Collecting pyjwt Downloading Collecting pyyaml~=5.1 Downloading (265kB) |████████████████████████████████| 266kB 9.7MB/s Collecting SQLAlchemy~=1.3.0 Downloading (6.0MB) |████████████████████████████████| 6.0MB 101kB/s Requirement already satisfied: requests~=2.22 in ./.local/lib/python3.6/site-packages (from rasa-x) (2.22.0) Collecting jsonschema~=2.6.0 Downloading Collecting alembic~=1.0.10 Downloading (164kB) |████████████████████████████████| 174kB 962kB/s Collecting pika~=1.0.0 Downloading (148kB) |████████████████████████████████| 153kB 6.5MB/s Collecting questionary>=1.1.0 Downloading Collecting setuptools-scm~=3.3 Using cached Collecting apscheduler~=3.5 Downloading (58kB) |████████████████████████████████| 61kB 2.6MB/s Collecting sanic~=19.6 Downloading (73kB) |████████████████████████████████| 81kB 3.4MB/s Collecting sanic-jwt~=1.3 Downloading Collecting isodate~=0.6.0 Downloading (45kB) |████████████████████████████████| 51kB 2.7MB/s Collecting python-dateutil~=2.8 Downloading (227kB) |████████████████████████████████| 235kB 10.7MB/s Collecting kafka-python~=1.4 Downloading (266kB) |████████████████████████████████| 266kB 11.1MB/s Collecting python-telegram-bot~=11.0 Downloading (326kB) |████████████████████████████████| 327kB 10.9MB/s Collecting terminaltables~=3.1 Downloading Collecting scipy~=1.2 Using cached Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … done Collecting colorhash~=1.0 Downloading Collecting coloredlogs~=10.0 Downloading (47kB) |████████████████████████████████| 51kB 1.2MB/s Collecting redis~=3.3.5 Downloading (66kB) |████████████████████████████████| 71kB 2.3MB/s Collecting slackclient~=1.3 Downloading Collecting networkx~=2.3.0 Downloading (1.7MB) |████████████████████████████████| 1.8MB 8.6MB/s Collecting gast==0.2.2 Downloading Collecting tensorflow-probability~=0.7.0 Using cached Collecting async-generator~=1.10 Downloading Collecting twilio~=6.0 Downloading (1.0MB) |████████████████████████████████| 1.0MB 792kB/s Collecting tensorflow~=1.14.0 Downloading (100.7MB) |████████████████████████████████| 100.7MB 12kB/s Collecting rasa-sdk~=1.4.0 Downloading Collecting matplotlib~=3.0 Downloading (37.8MB) |████████████████████████████████| 37.8MB 35kB/s Collecting scikit-learn~=0.20.2 Downloading (11.7MB) |████████████████████████████████| 11.7MB 79kB/s Collecting tensor2tensor~=1.14.0 Downloading (1.6MB) |████████████████████████████████| 1.6MB 9.4MB/s Collecting pytz~=2019.1 Downloading (509kB) |████████████████████████████████| 512kB 7.9MB/s Requirement already satisfied: tqdm~=4.0 in ./.local/lib/python3.6/site-packages (from rasa~=1.4.0->rasa-x) (4.38.0) Collecting absl-py>=0.8.0 Using cached Collecting colorclass~=2.2 Downloading Collecting gevent~=1.4 Using cached Collecting ruamel.yaml~=0.15.0 Downloading (318kB) |████████████████████████████████| 327kB 9.6MB/s Collecting python-engineio>=3.9.3 Downloading (120kB) |████████████████████████████████| 122kB 8.8MB/s Collecting fbmessenger~=6.0 Downloading Collecting pykwalify~=1.7.0 Downloading (40kB) |████████████████████████████████| 40kB 2.3MB/s Collecting mattermostwrapper~=2.0 Downloading Collecting jsonpickle~=1.1 Downloading Collecting webexteamssdk~=1.1 Downloading (82kB) |████████████████████████████████| 92kB 777kB/s Collecting pydot~=1.4 Downloading Collecting python-socketio>=4.3.1 Downloading (49kB) |████████████████████████████████| 51kB 2.0MB/s Collecting pymongo[srv,tls]~=3.8 Downloading (701kB) |████████████████████████████████| 706kB 9.0MB/s Requirement already satisfied: numpy~=1.16 in ./.local/lib/python3.6/site-packages (from rasa~=1.4.0->rasa-x) (1.17.3) Collecting sklearn-crfsuite~=0.3.6 Downloading Collecting rocketchat-API~=0.6.0 Downloading Requirement already satisfied: setuptools>=41.0.0 in ./.local/lib/python3.6/site-packages (from rasa~=1.4.0->rasa-x) (41.6.0) Requirement already satisfied: packaging~=19.0 in ./.local/lib/python3.6/site-packages (from rasa~=1.4.0->rasa-x) (19.2) Collecting boto3~=1.9 Downloading (128kB) |████████████████████████████████| 133kB 5.5MB/s Collecting multidict<5.0,>=4.5 Downloading (105kB) |████████████████████████████████| 112kB 8.7MB/s Collecting async-timeout<4.0,>=3.0 Downloading Collecting idna-ssl>=1.0; python_version < “3.7” Downloading Collecting yarl<2.0,>=1.0 Downloading (159kB) |████████████████████████████████| 163kB 10.3MB/s Collecting typing-extensions>=3.6.5; python_version < “3.7” Downloading Requirement already satisfied: chardet<4.0,>=2.0 in ./.local/lib/python3.6/site-packages (from aiohttp~=3.5->rasa-x) (3.0.4) Collecting sanic-plugins-framework>=0.8.2 Downloading Requirement already satisfied: six>=1.4.1 in ./.local/lib/python3.6/site-packages (from cryptography~=2.7->rasa-x) (1.13.0) Collecting cffi!=1.11.3,>=1.8 Using cached Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python3.6/site-packages (from requests~=2.22->rasa-x) (2019.9.11) Requirement already satisfied: idna<2.9,>=2.5 in ./.local/lib/python3.6/site-packages (from requests~=2.22->rasa-x) (2.8) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./.local/lib/python3.6/site-packages (from requests~=2.22->rasa-x) (1.25.6) Collecting python-editor>=0.3 Downloading Collecting Mako Downloading (75kB) |████████████████████████████████| 81kB 504kB/s Collecting prompt-toolkit~=2.0 Downloading (340kB) |████████████████████████████████| 348kB 8.7MB/s Collecting tzlocal>=1.2 Downloading Collecting ujson>=1.35; sys_platform != “win32” and implementation_name == “cpython” Downloading (192kB) |████████████████████████████████| 194kB 10.3MB/s Collecting requests-async==0.5.0 Downloading Collecting websockets<9.0,>=7.0 Downloading (58kB) |████████████████████████████████| 61kB 3.0MB/s WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’,))’: /simple/aiofiles/ Collecting aiofiles>=0.3.0 Downloading Collecting uvloop>=0.5.3; sys_platform != “win32” and implementation_name == “cpython” Downloading (2.0MB) |████████████████████████████████| 2.0MB 6.4MB/s Collecting httptools>=0.0.10 Downloading (104kB) |████████████████████████████████| 112kB 8.5MB/s Collecting future>=0.16.0 Using cached Collecting humanfriendly>=4.7 Downloading (73kB) |████████████████████████████████| 81kB 1.5MB/s Collecting websocket-client<0.55.0,>=0.35 Downloading (200kB) |████████████████████████████████| 204kB 7.9MB/s Collecting decorator>=4.3.0 Downloading Collecting cloudpickle>=0.6.1 Using cached Collecting wrapt>=1.11.1 Downloading Collecting grpcio>=1.8.6 Downloading (14.9MB) |████████████████████████████████| 14.9MB 37kB/s Collecting astor>=0.6.0 Downloading Collecting tensorboard<1.15.0,>=1.14.0 Downloading (3.1MB) |████████████████████████████████| 3.2MB 11.1MB/s Collecting keras-preprocessing>=1.0.5 Downloading (41kB) |████████████████████████████████| 51kB 2.8MB/s Collecting termcolor>=1.1.0 Downloading Collecting protobuf>=3.6.1 Downloading (434kB) |████████████████████████████████| 440kB 7.8MB/s Collecting google-pasta>=0.1.6 Downloading (57kB) |████████████████████████████████| 61kB 2.9MB/s Collecting keras-applications>=1.0.6 Downloading (50kB) |████████████████████████████████| 51kB 2.5MB/s Collecting wheel>=0.26 Using cached Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 Downloading (488kB) |████████████████████████████████| 491kB 10.0MB/s Collecting ConfigArgParse>=0.14 Downloading Collecting flask~=1.0 Using cached Collecting flask-cors~=3.0 Downloading Collecting cycler>=0.10 Downloading Collecting kiwisolver>=1.0.1 Downloading Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./.local/lib/python3.6/site-packages (from matplotlib~=3.0->rasa~=1.4.0->rasa-x) (2.4.5) Collecting dopamine-rl Downloading (77kB) |████████████████████████████████| 81kB 852kB/s Collecting tensorflow-datasets Using cached Collecting sympy Using cached WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’,))’: /simple/kfac/ Collecting kfac Using cached Collecting gin-config Using cached Collecting gym Using cached Collecting h5py Using cached Collecting bz2file Using cached Collecting mesh-tensorflow Using cached Collecting gunicorn Using cached ERROR: Could not find a version that satisfies the requirement opencv-python (from tensor2tensor~=1.14.0->rasa~=1.4.0->rasa-x) (from versions: none) ERROR: No matching distribution found for opencv-python (from tensor2tensor~=1.14.0->rasa~=1.4.0->rasa-x) <<<

Thanks for help!