Error rasa init after install RASA

Hi !

Hi, I’m newer in RASA user. I follow instructions for install RASA on my server and install dependencies.

root@ubuntu:/var/www# sudo pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple
Looking in indexes: https://pypi.org/simple, https://pypi.rasa.com/simple
Processing /root/.cache/pip/wheels/d1/11/9a/1ab265a36bddef3bbb87eb0edf31d94159c9cf8ed53466126d/rasa_x-0.23.3-cp36-none-any.whl
Requirement already satisfied: questionary>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (1.4.0)
Collecting rasa~=1.5.1
  Using cached https://files.pythonhosted.org/packages/4f/25/2fc80c396c78aed0b79e5b6bb2fd5231549eca772a1fccb4ecc5ad3e898b/rasa-1.5.2-py3-none-any.whl
Requirement already satisfied: SQLAlchemy~=1.3.0 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (1.3.11)
Requirement already satisfied: aiohttp~=3.5 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (3.6.2)
Requirement already satisfied: requests~=2.22 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (2.22.0)
Requirement already satisfied: jsonschema~=3.0 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (3.2.0)
Requirement already satisfied: pika~=1.0.0 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (1.0.1)
Requirement already satisfied: sanic-cors==0.9.9.post1 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (0.9.9.post1)
Requirement already satisfied: isodate~=0.6.0 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (0.6.0)
Requirement already satisfied: pyyaml~=5.1 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (5.2)
Requirement already satisfied: sanic-jwt~=1.3 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (1.3.2)
Collecting apscheduler~=3.5
  Using cached https://files.pythonhosted.org/packages/f3/34/9ef20ed473c4fd2c3df54ef77a27ae3fc7500b16b192add4720cab8b2c09/APScheduler-3.6.3-py2.py3-none-any.whl
Requirement already satisfied: attrs>=18 in /usr/local/lib/python3.6/dist-packages (from rasa-x) (19.3.0)
[...]
Collecting cachetools<3.2,>=2.0.0
  Using cached https://files.pythonhosted.org/packages/2f/a6/30b0a0bef12283e83e58c1d6e7b5aabc7acfc4110df81a4471655d33e704/cachetools-3.1.1-py2.py3-none-any.whl
Requirement already satisfied: hyperframe<6,>=5.2.0 in /usr/local/lib/python3.6/dist-packages (from h2==3.*->httpcore==0.3.*->requests-async==0.5.0->sanic~=19.9->rasa-x) (5.2.0)
Requirement already satisfied: hpack<4,>=2.3 in /usr/local/lib/python3.6/dist-packages (from h2==3.*->httpcore==0.3.*->requests-async==0.5.0->sanic~=19.9->rasa-x) (3.0.0)
Installing collected packages: dnspython, pymongo, humanfriendly, coloredlogs, ConfigArgParse, rasa-sdk, jmespath, docutils, botocore, s3transfer, boto3, async-generator, greenlet, gevent, numpy, scipy, scikit-learn, python-engineio, python-socketio, colorhash, colorclass, kafka-python, jsonpickle, webexteamssdk, tzlocal, apscheduler, cloudpickle, decorator, tensorflow-probability, cycler, pyparsing, kiwisolver, matplotlib, fbmessenger, docopt, pykwalify, python-telegram-bot, tqdm, absl-py, markdown, werkzeug, protobuf, grpcio, tensorboard, h5py, keras-applications, opt-einsum, tensorflow-estimator, google-pasta, wrapt, astor, termcolor, gast, keras-preprocessing, tensorflow, rsa, oauth2client, opencv-python, tensorflow-hub, tensorflow-gan, gin-config, mesh-tensorflow, pyglet, gym, dopamine-rl, gunicorn, mpmath, sympy, bz2file, kfac, googleapis-common-protos, tensorflow-metadata, promise, dill, tensorflow-datasets, Pillow, cachetools, google-auth, uritemplate, google-auth-httplib2, google-api-python-client, pypng, Jinja2, itsdangerous, flask, tensor2tensor, packaging, rocketchat-API, pydot, terminaltables, redis, ruamel.yaml, python-crfsuite, tabulate, sklearn-crfsuite, websocket-client, slackclient, networkx, mattermostwrapper, twilio, rasa, smmap2, gitdb2, GitPython, rasa-x
  Found existing installation: ConfigArgParse 0.11.0
    Uninstalling ConfigArgParse-0.11.0:
      Successfully uninstalled ConfigArgParse-0.11.0
Successfully installed ConfigArgParse-0.15.2 GitPython-3.0.5 Jinja2-2.10.3 Pillow-6.2.1 absl-py-0.8.1 apscheduler-3.6.3 astor-0.8.1 async-generator-1.10 boto3-1.10.36 botocore-1.13.36 bz2file-0.98 cachetools-3.1.1 cloudpickle-1.2.2 colorclass-2.2.0 coloredlogs-10.0 colorhash-1.0.2 cycler-0.10.0 decorator-4.4.1 dill-0.3.1.1 dnspython-1.16.0 docopt-0.6.2 docutils-0.15.2 dopamine-rl-2.0.5 fbmessenger-6.0.0 flask-1.1.1 gast-0.2.2 gevent-1.4.0 gin-config-0.2.1 gitdb2-2.0.6 google-api-python-client-1.7.11 google-auth-1.8.1 google-auth-httplib2-0.0.3 google-pasta-0.1.8 googleapis-common-protos-1.6.0 greenlet-0.4.15 grpcio-1.25.0 gunicorn-20.0.4 gym-0.15.4 h5py-2.10.0 humanfriendly-4.18 itsdangerous-1.1.0 jmespath-0.9.4 jsonpickle-1.2 kafka-python-1.4.7 keras-applications-1.0.8 keras-preprocessing-1.1.0 kfac-0.2.0 kiwisolver-1.1.0 markdown-3.1.1 matplotlib-3.1.2 mattermostwrapper-2.1 mesh-tensorflow-0.1.7 mpmath-1.1.0 networkx-2.3 numpy-1.17.4 oauth2client-4.1.3 opencv-python-4.1.2.30 opt-einsum-3.1.0 packaging-19.2 promise-2.2.1 protobuf-3.11.1 pydot-1.4.1 pyglet-1.3.2 pykwalify-1.7.0 pymongo-3.10.0 pyparsing-2.4.5 pypng-0.0.20 python-crfsuite-0.9.6 python-engineio-3.11.1 python-socketio-4.4.0 python-telegram-bot-11.1.0 rasa-1.5.2 rasa-sdk-1.5.1 rasa-x-0.23.3 redis-3.3.11 rocketchat-API-0.6.36 rsa-4.0 ruamel.yaml-0.15.100 s3transfer-0.2.1 scikit-learn-0.20.4 scipy-1.3.3 sklearn-crfsuite-0.3.6 slackclient-1.3.2 smmap2-2.0.5 sympy-1.4 tabulate-0.8.6 tensor2tensor-1.14.1 tensorboard-1.15.0 tensorflow-1.15.0 tensorflow-datasets-1.3.2 tensorflow-estimator-1.15.1 tensorflow-gan-2.0.0 tensorflow-hub-0.7.0 tensorflow-metadata-0.15.1 tensorflow-probability-0.7.0 termcolor-1.1.0 terminaltables-3.1.0 tqdm-4.40.2 twilio-6.34.0 tzlocal-2.0.0 uritemplate-3.0.0 webexteamssdk-1.2 websocket-client-0.54.0 werkzeug-0.16.0 wrapt-1.11.2

But when I try to initiate a project, I get this error :

root@ubuntu:/var/www# rasa init --no-prompt
Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 5, in <module>
    from rasa.__main__ import main
  File "/usr/local/lib/python3.6/dist-packages/rasa/__init__.py", line 8, in <module>
    from rasa.run import run
  File "/usr/local/lib/python3.6/dist-packages/rasa/run.py", line 7, in <module>
    from rasa.core.lock_store import LockStore
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/__init__.py", line 5, in <module>
    from rasa.core.train import train
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/train.py", line 11, in <module>
    from rasa.core.domain import Domain
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/domain.py", line 11, in <module>
    import rasa.utils.common as common_utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/common.py", line 7, in <module>
    import rasa.core.utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/utils.py", line 27, in <module>
    from sanic import Sanic
  File "/usr/local/lib/python3.6/dist-packages/sanic/__init__.py", line 2, in <module>
    from sanic.app import Sanic
  File "/usr/local/lib/python3.6/dist-packages/sanic/app.py", line 18, in <module>
    from sanic.asgi import ASGIApp
  File "/usr/local/lib/python3.6/dist-packages/sanic/asgi.py", line 22, in <module>
    from sanic.compat import Header
  File "/usr/local/lib/python3.6/dist-packages/sanic/compat.py", line 4, in <module>
    class Header(CIMultiDict):
TypeError: type 'multidict._multidict.CIMultiDict' is not an acceptable base type

I don’t know how to fix this problem.

Thanks for you helps. Valentin

Hi, @valdu02100 !

Try using virtual environments to avoid problems with dependencies.

https://rasa.com/docs/rasa/user-guide/installation/#create-a-virtual-environment-strongly-recommended

It looks that multidict in 4.7.1 changed API and in a result broke environment. Rasa is not the only affected project: Multidicts 4.7.0 - TypeError: type 'multidict._multidict.CIMultiDict' is not an acceptable base type (#285) · Issues · pgjones / quart · GitLab.

Our workaround for now was after installing all packages manually retract used version:

pip uninstall -y multidict pip install multidict==4.6.1

Hi @valdu02100! What a day to be installing, when one of our dependency’s dependencies broke things yesterday :sweat_smile: @trytytka is right, for now, the best way at the moment for rasa x is to pin the multidict version as suggested.

There is already a fix released pinning the version in our code for rasa and rasa-sdk, the rasa-x one should come today :slight_smile:

Hello,

Thank you for your feedback. I went through venv and reinstall rasa as suggested in the documentation and directly via the git repository. Despite this, the error is still present.

(venv) root@ubuntu:/var/www# pip install multidict==4.6.1
Requirement already satisfied: multidict==4.6.1 in /venv/lib/python3.6/site-packages (4.6.1)
(venv) root@ubuntu:/var/www# rasa init --no-prompt
Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 5, in <module>
    from rasa.__main__ import main
  File "/usr/local/lib/python3.6/dist-packages/rasa/__init__.py", line 8, in <module>
    from rasa.run import run
  File "/usr/local/lib/python3.6/dist-packages/rasa/run.py", line 7, in <module>
    from rasa.core.lock_store import LockStore
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/__init__.py", line 5, in <module>
    from rasa.core.train import train
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/train.py", line 11, in <module>
    from rasa.core.domain import Domain
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/domain.py", line 11, in <module>
    import rasa.utils.common as common_utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/common.py", line 7, in <module>
    import rasa.core.utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/utils.py", line 25, in <module>
    import aiohttp
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/__init__.py", line 5, in <module>
    from . import hdrs as hdrs
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/hdrs.py", line 6, in <module>
    from multidict import istr
ModuleNotFoundError: No module named 'multidict'

I will wait for the patch and try to reinstall all the packages…

Hope you figured this out, the latest versions should have that fixed :slight_smile: sudo pip3 install -U --extra-index-url https://pypi.rasa.com/simple should do it!

2 Likes

Thank you ! This also helps to solve the " ModuleNotFoundError: No module named ‘tensorflow.python.tools’; ‘tensorflow.python’ is not a package" error.