spaCy: 'spacy' is a package and cannot be directly executed

How to reproduce the behaviour

As described in the documentation, I run the following command to install spaCy:

conda install -c conda-forge spacy

However, if I call:

python -m spacy download en

It fails with the following error message:

/opt/conda/bin/python: No module named spacy.__main__; 'spacy' is a package and cannot be directly executed

Your Environment

  • Operating System: Ubuntu 18.04
  • Python Version Used: Python 3.6 (Anaconda distribution)
  • spaCy Version Used:
  • Environment Information: I also tried to install it in inside Docker image (FROM continuumio/anaconda3), and it fails. A few weeks ago, it worked without any problem.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Update: After reading through condas debugging logs, I think we found the culprit – msgpack-python. If the Anaconda distribution was recently updated to include the new msgpack, this would also explain why this problem only started to come up recently. msgpack is incompatible with msgpack-python and the “latest” spaCy version that is compatible is 0.101.0, because it didn’t depend on any of those.

The bad news: As a result, installing spaCy from the recent Anaconda distribution will currently download 0.101.0 (which is now about two years old?). This happens pretty much always.

The good news: We can fix this by publishing a patch release to Thinc that requires msgpack.