Can't init a new rasa project

Hello i’m new in this forum and i’m searching to create an assistant. The problem is i can’t init a new projet with the following command :

rasa init --no-prompt

I’ve got this error :

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/rasa/__init__.py", line 8 in <module>
    from rasa.run import run
  File "/usr/local/lib/python3.5/dist-packages/rasa/run.py", line 7, in <module>
    from rasa.core.lock_store import LockStore
  File "/usr/local/lib/python3.5/dist-packages/rasa/core/lock_store.py", line 10, in <module>
    from rasa.core.lock import TicketLock, NO_TICKET_ISSUED
  File "/usr/local/lib/python3.5/dist-packages/rasa/core/lock.py", line 4, in <module>
    from typing import Text, Optional, Union, Dict, Deque, Any
ImportError: cannot import name 'Deque'

I followed the installation guide from RASA docs :

apt update
apt install python3-dev python3-pip
pip3 install rasa

I’m running rasa on Debian 9.11 (stretch).

It is better that use Ubuntu or not ? there is missing python package ?

Thanks for help.

What Rasa version are you using? We removed the python3.5 support in Rasa 1.4.0. But not sure if that is related.

I can’t know the Rasa version. When i use the command “rasa”, the error mentionned above on top appear.

Are you using a virtualenv? If not, I would recommend to do so (Installation).

Hello Tanja, I kinda had the same issue.

I was following the manual installing tutorial

I did the following steps:

python3 -m venv --system-site-packages ./venv
source ./venv/bin/activate
pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple

However when I tried to run rasa init --no-prompt , it reports the following error:

Traceback (most recent call last):
  File "/Users/xxxxx/Rasa/rasa-nlu-demo/venv/bin/rasa", line 6, in <module>
    from rasa.__main__ import main
ModuleNotFoundError: No module named 'rasa'

@coorfang Did you got any error? Are you sure, you activated the virtualenv?

(venv) C:\Users\liya\Desktop\bot>rasa init
Traceback (most recent call last):
  File "c:\users\liya\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\liya\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\liya\Python\Python36\Scripts\rasa.exe\__main__.py", line 4, in <module>
  File "c:\users\liya\python\python36\lib\site-packages\rasa\__init__.py", line 8, in <module>
    from rasa.run import run
  File "c:\users\liya\python\python36\lib\site-packages\rasa\run.py", line 7, in <module>
    from rasa.core.lock_store import LockStore
  File "c:\users\liya\python\python36\lib\site-packages\rasa\core\__init__.py", line 5, in <module>
    from rasa.core.train import train
  File "c:\users\liya\python\python36\lib\site-packages\rasa\core\train.py", line 11, in <module>
    from rasa.core.domain import Domain
  File "c:\users\liya\python\python36\lib\site-packages\rasa\core\domain.py", line 11, in <module>
    import rasa.utils.common as common_utils
  File "c:\users\liya\python\python36\lib\site-packages\rasa\utils\common.py", line 7, in <module>
    import rasa.core.utils
  File "c:\users\liya\python\python36\lib\site-packages\rasa\core\utils.py", line 27, in <module>
    from sanic import Sanic
  File "c:\users\liya\python\python36\lib\site-packages\sanic\__init__.py", line 2, in <module>
    from sanic.app import Sanic
  File "c:\users\liya\python\python36\lib\site-packages\sanic\app.py", line 18, in <module>
    from sanic.asgi import ASGIApp
  File "c:\users\liya\python\python36\lib\site-packages\sanic\asgi.py", line 28, in <module>
    from sanic.websocket import WebSocketConnection
  File "c:\users\liya\python\python36\lib\site-packages\sanic\websocket.py", line 12, in <module>
    from websockets import (  # type: ignore
  File "c:\users\liya\python\python36\lib\site-packages\websockets\__init__.py", line 3, in <module>
    from .auth import *
  File "c:\users\liya\python\python36\lib\site-packages\websockets\auth.py", line 15, in <module>
    from .server import HTTPResponse, WebSocketServerProtocol
  File "c:\users\liya\python\python36\lib\site-packages\websockets\server.py", line 49, in <module>
    from .protocol import WebSocketCommonProtocol
  File "c:\users\liya\python\python36\lib\site-packages\websockets\protocol.py", line 18, in <module>
   

 from typing import (
**ImportError: cannot import name 'Deque'**

how can i solve this error i am using python 3.6

@alien what rasa version are you using?

I am also having the same problem. Please tell me how should I remove this problem

@maadhav_sharma You should use venv to skip this problem :

python3 -m venv --system-site-packages ./venv
source ./venv/bin/activate

And after, you can install rasa :

pip install -U pip
pip install rasa
1 Like

I solved it by using Python 3.6.4

1 Like

@Tanja

Python version: Python 3.7.3 Rasa version:1.10.1 I’m facing similar issue while initiating a new rasa project. Could you please advice?

rasa init --no-prompt

Traceback (most recent call last):
  File "/Users/abhinavpalakurthy/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/rasa/__main__.py", line 82, in main
    set_log_level(log_level)
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/rasa/utils/common.py", line 71, in set_log_level
    update_tensorflow_log_level()
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/rasa/utils/common.py", line 112, in update_tensorflow_log_level
    import tensorflow as tf
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 101, in <module>
    from tensorflow_core import *
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 959, in _find_and_load_unlocked
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 64, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/tensorflow_core/core/framework/graph_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/google/protobuf/__init__.py", line 37, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 84, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
    from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/extern/__init__.py", line 43, in load_module
    __import__(extant)
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 4756, in <module>
    _escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1284, in setParseAction
    self.parseAction = list(map(_trim_arity, list(fns)))
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1066, in _trim_arity
    this_line = extract_stack(limit=2)[-1]
  File "/Users/abhinavpalakurthy/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1050, in extract_stack
    frame_summary = traceback.extract_stack(limit=-offset+limit-1)[offset]
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 211, in extract_stack
    stack = StackSummary.extract(walk_stack(f), limit=limit)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 363, in extract
    f.line
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 285, in line
    self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 16, in getline
    lines = getlines(filename, module_globals)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 48, in getlines
    for mod in sys.modules.values():
RuntimeError: dictionary changed size during iteration

@pavanpolneni22 This seems to be an issue with Tensorflow. Please check out this thread, hope that helps: RuntimeError: dictionary changed size during iteration · Issue #33183 · tensorflow/tensorflow · GitHub

ImportError: cannot import name ‘NoReturn’ I am getting the above error while doing rasa init