Unable to download Spacy

I have done installing rasa spacy and as the next step I tried downloading spacy which i failed by giving out a message as follows.

/usr/local/bin/python3: No module named spacy

What command did you use?

Thank you for your reply.

pip install -U "rasa[spacy]"
python3 -m spacy download en_core_web_md

these commands were used and the second one returns me the mentioned output.

Please show me the outputs of pip -V and python3 -V

@ChrisRahme hi, I was a bit away from my workstation, will you please tell me if i want to connect the pip and python is it okay to make them to the same python version?? else explain a bit the way to continue

See, your Pip and Python are not connected.

When you use pip you’re using Python 3.8, and when you use python you’re using Python 3.7.

I suggest using python 3 -m pip instead of pip to ensure they use the same version.

1 Like

Was your problem solved? If yes, please mark the answer that helped as solution, otherwise feel free to ask :slight_smile:

@ChrisRahme hi, I was a bit away from my workstation. is it okay to make both python versions the same to proceed with work as usual?? or will you bit explain to me more on the suggested solution.

The problem is not that both instances of Python have different versions - it’s that they are two instances to begin with!

If you bought two of the same computers, when you create a folder in one it will not create it in another. Same logic here.

If you’d rather use pip than python 3 -m pip, you can add the following to your ~/.bashrc file:

alias python='python3'
alias pip='python -m pip`

The first line will translate python to python3 in the shell, and the second will translate pip to python -m pip then python3 -m pip.

You will need to open a new terminal for the changes to take effect.

Please let me know if you need any more help of if it was solved :slight_smile:

hi, @ChrisRahme I tried and successfully download the spacy. but it gives out me an error when I am trying to train the model.

encountered Error

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

Try pip install sanic==21.9.3 as per this post.

If it does not work, please show the output of rasa --version.

This sanic==21.9.3 version does not work for me and the rasa --version command is also giving me the same error.

rasa 3.0.5

rasa-sdk 3.0.3

rasa-x 0.42.0

Full encountered error is.

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)

@nik202 you’re the pro for these kinds of errors

@ChrisRahme Thanks Chris. I guess this CompositionView is not related to the main topic as he successfully able to download the spacy as per your suggestions and issue coming when training. He already created new thread for same error, for your Ref: ImportError: cannot import name 'CompositionView' from 'sanic.views' (/Users/rajithabandara/opt/anaconda3/envs/rasabotv3_spacy/lib/python3.8/site-packages/sanic/views.py)

Thanks for the tag, I am helping him on another thread :slight_smile:

1 Like

Thank you both @ChrisRahme and nik202 for your support and ill continue with Nik on the other thread.

@RajithaBandara please close this thread as a solution for others and see you on another thread :slight_smile:

1 Like