Akshay Kumar
Akshay Kumar

Reputation: 11

/usr/bin/python: No module named spacy

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:

Upvotes: 1

Views: 2957

Answers (2)

questionto42
questionto42

Reputation: 9532

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.

Upvotes: 0

Rshad Zhran
Rshad Zhran

Reputation: 636

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

Upvotes: 2

Related Questions