Rasa Installation - Step by Step

Hello,

I have been trying to install Rasa on Ubuntu18.x and Ubuntu 20.x and it has been always the same issue with Rasa giving illegal instruction and illegal instruction code dump, can anyone has an exact reference manual that can be referred to for installation which has exact information of which TensorFlow version and other dependencies are required for rasa version. any help is appreciated.

Thanks in advance

Hello and welcome to the community :slight_smile:

The installation is actually one simple step:

pip install rasa

But, as mentioned in the docs, you need:

  • Ubuntu, macOS, or Windows
  • Python 3.7 or 3.8

It will itself download all the correct versions of TensorFlow and other needed libraries. For this reason, and to not conflict with projects that may need other requirements, it would be better to execute that in a Python virtual envronment.

The steps become:

  • On Windows:
python -m venv ./rasaenv # Create a virtual environment in your current folder
rasaenv\Scripts\activate.bat # Activate the virtual environment
pip install rasa # Install Rasa and its dependencies in the virtual environment
rasa init # Creates a basic Rasa project in your current folder
  • On Ubuntu:
python3 -m venv ./rasaenv # Create a virtual environment in your current folder
source ./rasaenv/bin/activate # Activate the virtual environment
python3 -m pip install rasa # Install Rasa and its dependencies in the virtual environment
python3 -m rasa init # Creates a basic Rasa project in your current folder

Note: You will always need to activate the virtual environment every time you want to work with Rasa.


If you’re getting errors, please show the exact command you’re executing and the exact error you’re getting.

Hi @chetangjha Can you please clarify which Rasa version you are trying to install and what errors you are facing with some screenshots? Please even can you tell me what do you mean by this?

Thanks.

Hello Chris , Tried the above and below is the error I am getting

Building wheels for collected packages: mattermostwrapper, pyTelegramBotAPI, twilio, randomname, termcolor, wrapt, clang, docopt, future, fire
  Building wheel for mattermostwrapper (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/mattermostwrapper/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/mattermostwrapper/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-itos9oe4
       cwd: /tmp/pip-install-coaev425/mattermostwrapper/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for mattermostwrapper
  Running setup.py clean for mattermostwrapper
  Building wheel for pyTelegramBotAPI (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/pyTelegramBotAPI/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/pyTelegramBotAPI/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-t6ddk9k8
       cwd: /tmp/pip-install-coaev425/pyTelegramBotAPI/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for pyTelegramBotAPI
  Running setup.py clean for pyTelegramBotAPI
  Building wheel for twilio (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/twilio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/twilio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-g3lqd87x
       cwd: /tmp/pip-install-coaev425/twilio/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for twilio
  Running setup.py clean for twilio
  Building wheel for randomname (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/randomname/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/randomname/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pu67_7oj
       cwd: /tmp/pip-install-coaev425/randomname/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for randomname
  Running setup.py clean for randomname
  Building wheel for termcolor (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/termcolor/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/termcolor/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-mc8hb0i7
       cwd: /tmp/pip-install-coaev425/termcolor/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for termcolor
  Running setup.py clean for termcolor
  Building wheel for wrapt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/wrapt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/wrapt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8dtl05yd
       cwd: /tmp/pip-install-coaev425/wrapt/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for wrapt
  Running setup.py clean for wrapt
  Building wheel for clang (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/clang/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/clang/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vqhzsx6h
       cwd: /tmp/pip-install-coaev425/clang/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for clang
  Running setup.py clean for clang
  Building wheel for docopt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/docopt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/docopt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-zqbv7qy4
       cwd: /tmp/pip-install-coaev425/docopt/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for docopt
  Running setup.py clean for docopt
  Building wheel for future (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/future/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/future/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-udivvzuy
       cwd: /tmp/pip-install-coaev425/future/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for future
  Running setup.py clean for future
  Building wheel for fire (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/src/bots/rasaenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-coaev425/fire/setup.py'"'"'; __file__='"'"'/tmp/pip-install-coaev425/fire/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jk1r85uo
       cwd: /tmp/pip-install-coaev425/fire/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for fire
  Running setup.py clean for fire
Failed to build mattermostwrapper pyTelegramBotAPI twilio randomname termcolor wrapt clang docopt future fire
ERROR: sanic-jwt 1.7.0 has requirement pyjwt~=2.1.0, but you'll have pyjwt 2.3.0 which is incompatible.
ERROR: tensorflow 2.6.1 has requirement gast==0.4.0, but you'll have gast 0.5.3 which is incompatible.
ERROR: tensorflow 2.6.1 has requirement six~=1.15.0, but you'll have six 1.16.0 which is incompatible.
ERROR: tensorflow 2.6.1 has requirement typing-extensions~=3.7.4, but you'll have typing-extensions 3.10.0.2 which is incompatible.
ERROR: sanic-plugin-toolkit 1.2.1 has requirement sanic<21.12.0,>=21.3.1, but you'll have sanic 21.12.1 which is incompatible.
ERROR: rasa-sdk 3.0.3 has requirement uvloop<0.15.0; sys_platform != "win32", but you'll have uvloop 0.16.0 which is incompatible

I am using Ubuntu 20.04

Hello Nimit,

below is the screen shot

Please show the full output of python 3 -m pip -V.

Tip: Don’t just copy and paste commands, outputs, and code. Please properly format them by using three backticks (```) not apostrophes (’’’) a line before and a line after the code

```
like this
```

below is output

You have Python 3.6 (and a VERY old version of Pip)

Earlier I had , now downgraded to Ubuntu 18.04 to check on this version , have updated my python now

image

No need to downgrade the whole Ubuntu, just upgrade Python.

Anyway, now that you have Python 3.7, update Pip and try again.

@chetangjha My question remain the same “Which Rasa Version you are trying to install and where ? local machine or server” ??

Now as per your screenshots and conversations with Chris Rahme please understand and even I would recommend to read the documentation of rasa:

  1. If you are trying to install rasa using pip install rasa as I can see in the screenshot. This command will install Rasa 3.0.X version. Big but for installing Rasa 3.0.X you need Python version 3.7 and 3.8 only and in other screenshot I can see python 3.6, even chris pointed out to you. Thanks Chris :slight_smile:

  2. Please I would highly recommend to create conda environment or virtaul env python 3.7 or 3.8 for installling rasa 3.x or If you are planning for 2.X you can create 3.6 or 3.7 or 3.8 respectively.

  3. When you create the envionment or trying to install rasa with specific version such as pip install rasa==2.8.1 or 2.8.15 etc It will automatically take care every dependencies etc etc ; just sometimes it show some dependences and you just fixed it and all good to go.

  4. For pip you need a latest pip version I guess 21.2 is the latest (no sure) or it should be alleast 20.0.2.

  5. For installing rasa latest or olde you can see the following installation videos and select as per your machine: Installation Guides - YouTube

Good Luck!!

Hello Nimit,

The Issue Persists I am doing fresh install on Ubuntu 20.04 with the below environment

Python version image

PIP version image

setting it up in virtual environment only

below is PIP Packages list installed Package Version


absl-py 0.13.0 aio-pika 6.8.1 aiofiles 0.8.0 aiohttp 3.7.4 aiormq 3.3.1 APScheduler 3.7.0 astunparse 1.6.3 async-generator 1.10 async-timeout 3.0.1 attrs 21.2.0 bidict 0.21.4 boto3 1.20.42 botocore 1.23.42 CacheControl 0.12.10 cachetools 5.0.0 certifi 2021.10.8 cffi 1.15.0 chardet 3.0.4 charset-normalizer 2.0.10 clang 5.0 cloudpickle 1.6.0 colorclass 2.2.2 coloredlogs 15.0.1 colorhash 1.0.4 cryptography 36.0.1 cycler 0.11.0 dask 2021.11.2 decorator 5.1.1 dm-tree 0.1.6 dnspython 1.16.0 docopt 0.6.2 fbmessenger 6.0.0 fire 0.4.0 flatbuffers 1.12 fsspec 2022.1.0 future 0.18.2 gast 0.5.3 google-auth 2.4.1 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 greenlet 1.1.2 grpcio 1.43.0 h5py 3.1.0 httptools 0.3.0 humanfriendly 10.0 idna 3.3 importlib-metadata 4.10.1 jmespath 0.10.0 joblib 1.0.1 jsonpickle 2.0.0 jsonschema 3.2.0 kafka-python 2.0.2 keras 2.6.0 Keras-Preprocessing 1.1.2 kiwisolver 1.3.2 locket 0.2.1 Markdown 3.3.6 matplotlib 3.3.4 mattermostwrapper 2.2 msgpack 1.0.3 multidict 5.2.0 networkx 2.6.3 numpy 1.19.5 oauthlib 3.1.1 opt-einsum 3.3.0 packaging 20.9 pamqp 2.3.0 partd 1.2.0 Pillow 9.0.0 pip 20.0.2 pkg-resources 0.0.0 prompt-toolkit 2.0.10 protobuf 3.19.3 psycopg2-binary 2.9.3 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycparser 2.21 pydot 1.4.2 PyJWT 2.3.0 pykwalify 1.8.0 pymongo 3.10.1 pyparsing 3.0.7 pyrsistent 0.18.1 pyTelegramBotAPI 3.8.3 python-crfsuite 0.9.7 python-dateutil 2.8.2 python-engineio 4.3.1 python-socketio 5.5.1 pytz 2021.3 PyYAML 6.0 questionary 1.10.0 randomname 0.1.5 rasa 3.0.5 rasa-sdk 3.0.3 redis 3.5.3 regex 2021.8.28 requests 2.27.1 requests-oauthlib 1.3.0 requests-toolbelt 0.9.1 rocketchat-API 1.16.0 rsa 4.8 ruamel.yaml 0.16.13 ruamel.yaml.clib 0.2.6 s3transfer 0.5.0 sanic 21.12.1 Sanic-Cors 1.0.1 sanic-jwt 1.7.0 sanic-plugin-toolkit 1.2.1 sanic-routing 0.7.2 scikit-learn 0.24.2 scipy 1.7.3 sentry-sdk 1.3.1 setuptools 44.0.0 six 1.16.0 sklearn-crfsuite 0.3.6 slackclient 2.9.3 SQLAlchemy 1.4.31 tabulate 0.8.9 tarsafe 0.0.3 tensorboard 2.8.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 tensorflow 2.6.1 tensorflow-addons 0.14.0 tensorflow-estimator 2.6.0 tensorflow-hub 0.12.0 tensorflow-probability 0.13.0 tensorflow-text 2.6.0 termcolor 1.1.0 terminaltables 3.1.10 threadpoolctl 3.0.0 toolz 0.11.2 tqdm 4.62.3 twilio 6.50.1 typeguard 2.13.3 typing-extensions 3.10.0.2 typing-utils 0.1.0 tzlocal 2.1 ujson 4.3.0 urllib3 1.26.8 uvloop 0.14.0 wcwidth 0.2.5 webexteamssdk 1.6 websockets 10.1 Werkzeug 2.0.2 wheel 0.37.1 wrapt 1.12.1 yarl 1.7.2 zipp 3.7.0

and when installed I am getting the same error

although rasa is getting installed , I removed 3.x version and installed 2.5 and got it installed but now when training it is giving Illegal core dump issue.

Hello Again Nimit,

I installed 2.8.1 installed without any issues but it is giving core dump illegal instructions , and I see the below message in syslog

Jan 25 00:26:36 bots kernel: [ 1556.706905] traps: rasa[1700] trap invalid opcode ip:7ffb6fad7cc0 sp:7ffce9053568 error:0 in _pywrap_tensorflow_internal.so[7ffb61f16000+1d737000]

Regards CJ

@chetangjha have you installed an anaconda and create the environment ?

@chetangjha please share rasa --version?

@nik202 nope not tried with conda yet , trying it with venv, Rasa version is 2.8.1

@chetangjha did you follow this rasa init ?

@chetangjha you are also not in the project folder why?

@nik202 yes rasa init when asked for training it gives the error

@chetangjha well, I guess you have created in usr/src# itself can you type ls and share me the content?

chetang.jha@gmail.com

@chetangjha delete the email id from here.