Skip to content

TypeError: add_label() takes exactly 2 positional arguments (3 given) #9393

Discussion options

You must be logged in to vote

Hi @Dan-Essin ! Will definitely appreciate it if you format the code block properly so that it's easier to debug. 🙇

It seems like you're following a book that uses the v2 API but the spaCy version you have in your computer is already v3. The function parameters have changed during that version bump. To confirm which spaCy version you have, try running the following:

python -m spacy info

You have two options here:

  • Install a v2 version of spaCy and rerun the code: find out what spaCy version the book follows and install that instead
  • Port your code to the v3 version: the Tagger API has changed, add_label doesn't accept a values param anymore. You can check the migration doc here, and follow t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by polm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade Issues related to upgrading spaCy v2 spaCy v2.x
2 participants