1

I have already installed the Rasa and spacy. But when i try to download by below command

python -m spacy download en_core_web_md

On my Mac it says:

/usr/bin/python: No module named spacy

Could you please advise how to achieve it.

I also tried below options but still the same issue:

For macOS:

  • You can create the virtual environment by opening the command prompt and typing the following code:

    $ python3 -m venv --system-site-packages ./venv
    
  • You can activate the virtual environment by typing the following code:

    $ source ./venv/bin/activate
    
  • Installing Rasa and Rasa X:

    You can install both Rasa and Rasa X using the following code:

    $ pip install rasa-x --extra-index-url https://pypi.rasa.com/simple
    Use the following code only if you want to install Rasa:
    $ pip install rasa 
    
  • Install Rasa NLU and Spacy in the same command prompt:

    $ pip install rasa[spacy]
    
    $ python -m spacy download en_core_web_md
    
    $ python -m spacy link en_core_web_md en
    

2 Answers 2

2

I would recommend installing SpaCy separately, using pip, as follows:

pip install -U pip setuptools wheel
pip install -U spacy
python -m spacy download en_core_web_md
Sign up to request clarification or add additional context in comments.

2 Comments

Did the above steps it still says the same Successfully uninstalled spacy-2.2.4 Successfully installed MarkupSafe-1.1.1 catalogue-2.0.1 click-7.1.2 jinja2-2.11.3 pathy-0.3.4 pydantic-1.7.3 smart-open-3.0.0 spacy-3.0.1 spacy-legacy-3.0.1 srsly-2.4.0 thinc-8.0.1 typer-0.3.2 (chat_bot) Akshays-MacBook-Pro:~ Akshay$ python -m spacy download en_core_web_md /usr/bin/python: No module named spacy (chat_bot) Akshays-MacBook-Pro:~ Akshay$
I doubt that you're not using the same Python binary that corresponds to the pip you use when installing packages. To make sure you're installing the corresponding packages in the venv, then use the following paths: ..../venv/bin/python and ..../venv/bin/pip. Replace .... with the complete path.
0

Follow how should I install the English model of spacy on my jupyter notebook which runs on a google cloud instance?.

There, you will find two answers at the time of writing:

  • Run spacy.cli.download("my_language_model_name"), which should be the better way, see here.
  • The other asks you to change to python3, which works as well, see here.

Both get rid of the error.

PS: I do this in Jupyter Notebook, and one thing I forgot is to restart the kernel:

Note: you may need to restart the kernel to use updated packages.

But I am also not sure whether this is needed since after restarting the kernel, the error stayed the same, and the error vanished only with the code change listed above. And much later, for another module, restarting the kernel was not needed even though the warning popped up.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.