ImportError: cannot import name 'CompositionView' from 'sanic.views' (/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/sanic/views.py)

Continuing the discussion from ImportError: cannot import name 'CompositionView' from 'sanic.views' (c:\users\admin\anaconda3\lib\site-packages\sanic\views.py):

the solution did not worked for me please can anyone assist.

@RajithaBandara can you please share the rasa --version and your error screenshot.

rasa --version is also throwing the same error and i am sending the versions by pip list command

rasa 3.0.5

rasa-sdk 3.0.3

rasa-x 0.42.0

@RajithaBandara Apologies for getting back so late, can you share the traceback of the error with the screenshot?

@nik202 no worries friend, you are doing great in the Forum :relaxed:, posting traceback…

(rasabotv3_spacy)

Rajithas-MacBook-Pro:formbot rajithabandara$ rasa train
Traceback (most recent call last):
  File "/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/bin/rasa", line 5, in <module>
    from rasa.__main__ import main
  File "/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/rasa/__main__.py", line 14, in <module>
    from rasa.cli import (
  File "/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/rasa/cli/export.py", line 9, in <module>
    import rasa.core.utils
  File "/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/rasa/core/utils.py", line 25, in <module>
    from sanic.views import CompositionView
ImportError: cannot import name 'CompositionView' from 'sanic.views' (/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/sanic/views.py)

@RajithaBandara can you downgrade the sanic version? or please share me sanic version using the command pip list

@RajithaBandara I can see you are on Macbook, confirm with me at the time of installing rasa did you met with any compatibility issues did you ignore any issues?

@RajithaBandara Confirm to me that are you also able to open rasa x using rasa x command?

@nik202
to which version should I downgrade sanic?

sanic related versions are

sanic                   21.12.1
Sanic-Cors              1.0.0
sanic-jwt               1.6.0
sanic-plugin-toolkit    1.2.0
Sanic-Plugins-Framework 0.9.5
sanic-routing           0.7.2

Yes, when I was updating Rasa to version 3.0, I got a few errors related to rasa x but the logs said it was successful at the end.

Rasa x is not working as well, the same error pops out

@RajithaBandara your environment is disturbed now. I’d recommend to please create a new environment and then install rasa 3.x only.

@RajithaBandara your issue is solve here? Unable to download Spacy - #11 by ChrisRahme

1 Like

it worked thanks @nik202