Rasa: uvloop is stuck on rasa init

Created on 22 Jan 2020  ยท  16Comments  ยท  Source: RasaHQ/rasa

Rasa version:

โžœ  fastfood-bot git:(master) pip freeze | grep rasa
rasa==1.6.1
rasa-sdk==1.6.1
rasa-x==0.24.2

Python version:

fastfood-bot git:(master) python --version
Python 3.6.6

Operating system (windows, osx, ...):

mac

Issue:

When I run rasa init I get a huge dump of this in the terminal;

Unhandled exception in event loop:
  File "uvloop/cbhandles.pyx", line 68, in uvloop.loop.Handle._run
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/eventloop/utils.py", line 69, in schedule
    if not loop2._ready:  # type: ignore

Exception 'Loop' object has no attribute '_ready'

Error (including full traceback):

Eventually when I ctrl-c out I get this;

Unhandled exception in event loop:
  File "uvloop/loop.pyx", line 436, in uvloop.loop.Loop._on_idle
  File "uvloop/cbhandles.pyx", line 90, in uvloop.loop.Handle._run
  File "uvloop/cbhandles.pyx", line 70, in uvloop.loop.Handle._run
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 810, in in_term
    await _do_wait_for_enter("Press ENTER to continue...")
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 1147, in _do_wait_for_enter
    await session.app.run_async()
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 772, in run_async
    return await _run_async2()
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 754, in _run_async2
    result = await _run_async()
  File "/Users/vincent/Development/fastfood-bot/venv/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 690, in _run_async
    result = await f
Press ENTER to continue...
Cancelled by user

Ok. You can continue setting up by running 'rasa init' ๐Ÿ™‹๐Ÿฝโ€โ™€๏ธ
area critical type

Most helpful comment

I figured out the issue for rasa shell and rasa init. The problem is that some of the packages that Rasa depends on got updated. You want to make sure that your packages are the versions below to make this work:

  • google-auth==1.10.1
  • prompt-toolkit==2.0.10
  • questionary==1.4.0
  • SQLAlchemy==1.3.12
  • urllib3==1.25.7

Hope this helps!

All 16 comments

seems relevant to mention;

fastfood-bot git:(master) pip freeze | grep uvloop
uvloop==0.14.0

It also deserves mentioning that this works fine;

โžœ  fastfood-bot git:(master) rasa init --no-prompt

I actually did the same thing to get around it. However, when I run rasa shell, I get the same error as the one you are describing above.

I figured out the issue for rasa shell and rasa init. The problem is that some of the packages that Rasa depends on got updated. You want to make sure that your packages are the versions below to make this work:

  • google-auth==1.10.1
  • prompt-toolkit==2.0.10
  • questionary==1.4.0
  • SQLAlchemy==1.3.12
  • urllib3==1.25.7

Hope this helps!

Mhm... it seems that a version update messes things up often. See a previous bug of mine. Is this something that can be prevented?

There should probably be a requirements.txt-based setup. That would be tried and tested with the version numbers for packages so that there is less build breaking.

Thanks for the issue, @rgstephens will get back to you about it soon!

You may find help in the docs and the forum, too ๐Ÿค—

@koaning and @codeabiswas thanks for noting these dependency issues.

I'm seeing the same issue. I'm new to the python ecosystem. How do I make sure those dependencies get the proper versions?

@tettoffensive You can do a few things to make sure of this:

  1. Look into virtualenv to create virtual environments for this project. This will sandbox your project so that it does not affect the global dependencies that some of your other projects may run on.

  2. After you install Rasa and all of its dependencies have also been installed, before running rasa init to initialize the project, make sure you reinstall these packages with these version numbers:

  • google-auth==1.10.1
  • prompt-toolkit==2.0.10
  • questionary==1.4.0
  • SQLAlchemy==1.3.12
  • urllib3==1.25.7

You can do so by doing `pip install --force-reinstall

Hopefully this helps you to get back on track!

I fixed this following @codeabiswas's suggestion, although I only had to bump down the version for prompt-toolkit and questionary. Seems like the issue arises from one of those two packages.

To be more specific in case you install Rasa Open Source using the Quick Installation Approach, you have to follow it by a step pointed out by @ngould, to downgrade prompt-toolkit:

$ pip3 install rasa
$ pip install --upgrade prompt-toolkit==2.0.10

Now you should be able to run rasa init

The uvloop doesn't have _ready. We can just remove or comment that in utils.py. rasa init will work fine even after removing.

#if not loop2._ready:  # type: ignore
    #    func()
    #    return

just reproduced this in a clean env

Fixed in Rasa 1.6.2 ๐ŸŽ‰ Thanks for bringing this up! One of our dependencies broke, so it wasn't a bug in rasa itself but somewhere in the upstream dependencies.

Danke Schon.

Was this page helpful?
0 / 5 - 0 ratings