RuntimeError: this event loop is already running

Hi,

I am trying to run rasa shell but the following error appears. I have run rasa run actions in separate terminal but still get the error. How to solve this?

ERROR    asyncio  - Task exception was never retrieved
future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at /Users/.../rasa/core/run.py:131> exception=RuntimeError('this event loop is already running.')>

I also get the following:

self.run_async(pre_run=pre_run, set_exception_handler=set_exception_handler)
  File "uvloop/loop.pyx", line 1495, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1488, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
  File "uvloop/loop.pyx", line 511, in uvloop.loop.Loop._run
RuntimeError: this event loop is already running.

@ml2021 Hi, can you share the rasa --version?

OR

Try install these:

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

try solve the other related dependence whilst installing these packages.

1 Like

@nik202 Here is my version. Should I install those packages still?

Rasa Version      :         2.8.7
Minimum Compatible Version: 2.8.0
Rasa SDK Version  :         2.8.2
Rasa X Version    :         0.42.3
Python Version    :         3.7.4

@ml2021 try and see! @ml2021 are you using rasa x? or only rasa open source?

@nik202 when I run rasa X, I get the usual message of opening in a browser Starting Rasa X in local mode..., but nothing shows up. Just a blank page. It also says

ERROR sanic.root - Exception occurred while handling uri

Anyone know how to solve this?

@ml2021 means you are using rasa x yes or no?

I am trying to use Rasa X but it does not open up. I cant use rasa shell either because of the errors I previously said. Is this common in Rasa 2.8.7?

@rctatman if you also have any advice would be great

@ml2021 you not telling me what I am asking Maria; Any ways.

Delete the default browser cookie and cache and try run the rasa x

GoodLuck!

@nik202 Thanks for the help, I think I misunderstood. I am using Rasa Open Source and terminal, but also using Rasa X in local mode. However the webpage is blank. I get the following error

AttributeError: 'Sanic' object has no attribute 'auth'
'Sanic' object has no attribute 'auth'

I checked this topic AttributeError: 'Sanic' object has no attribute 'auth'

But my Rasa versions are different. (Rasa Version : 2.8.7, Rasa SDK Version : 2.8.2, Rasa X Version : 0.42.3). Do you know how to solve this?

@ml2021 Please try install this pip install sanic-jwt==1.6.0 are you using Mac or Window machine? Hope, this will work but I have doubt it will not.

@nik202 using Mac. I tried that and now I get

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
rasa 2.8.7 requires aiohttp!=3.7.4.post0,<3.8,>=3.6, but you have aiohttp 3.7.4.post0 which is incompatible.
rasa 2.8.7 requires apscheduler<3.8,>=3.6, but you have apscheduler 3.8.0 which is incompatible.

any idea?

@ml2021 Can you follow this solution ?

I’d recommend to create a fresh conda environment with python 3.8 and follow the step

`pip install rasa==2.8.1`
`pip install rasa-sdk==2.8.1'

check version rasa --version its install or not

then

pip install rasa-x==0.39.3 --extra-index-url https://pypi.rasa.com/simple

check rasa version rasa --version its install or not

You will see some error : ImportError: cannot import name ‘RowProxy’ from ‘sqlalchemy.engine’ Install

pip install SQLAlchemy==1.3.22 should fix it

If sanic related error: pip install sanic-jwt==1.6.0

delete .db if is showing alembic issue.

Good luck! I hope this will solve your issue.

@ml2021 Hey, are you able to solve this? Just a check

@nik202 Unfortunately this did not work. I had to start a project from scratch and reinstall Rasa, I am not sure what was failing. Rasa versions were all compatible.

@ml2021 Sorry to hear that :frowning: if you need any help do let us know. Good luck!

thank you

@rajas.black For ? :wink:

i was stuck, went through your pip installation comment. It worked for me.

@rajas.black :slight_smile: great!