Dinak lal V
Dinak lal V

Reputation: 81

ModuleNotFoundError: No module named spacy.training

Hi I am trying to import Example class from Spacy.training module. I am trying exact code as in documentation.

from spacy.training import Example

But I am getting "ModuleNotFoundError: No module named 'spacy.training'" How can I import Example class now?

Upvotes: 1

Views: 1635

Answers (1)

Talha Tayyab
Talha Tayyab

Reputation: 27375

Example was introduced in spacy version 3.

Link to Example https://spacy.io/api/example#_title

You can check the current version of your spacy with this command on your Jupyter cell:

!pip show spacy  

OR

spacy.__version__

Once you check the version, you can update to a latest version by:

!pip install -U spacy

Once, you get spacy 3 your problem will be resolved.

Upvotes: 4

Related Questions