Skip to content

Can't import en_core_web_trf: AttributeError: module 'spacy.lang.en' has no attribute '__all__' #7363

Discussion options

You must be logged in to vote

You were correct. I had installed spacy-nightly without uninstalling the included spacy first. Then I installed spacy-nightly and removed the original spacy, which messed things up.

The solution to install this in Colab is:

!yes | pip uninstall spacy
!pip install spacy-nightly[cuda100,transformers] --pre

After this the following code runs fine:

import spacy
import spacy_transformers
from spacy.cli import download


download("en_core_web_trf")
nlp = spacy.load("en_core_web_trf")

However, download now seems superfluous according to the debug output, since load can download.

@honnibal is there a relevant place in the documentation to add this? I would like to make my first PR if there is :)

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ines
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install Installation issues
3 participants
Converted from issue

This discussion was converted from issue #6830 on March 09, 2021 13:22.