8000 Spacy 3.7.5 not working with python 3.12.4 · Issue #13550 · explosion/spaCy · GitHub
[go: up one dir, main page]

Skip to content
Spacy 3.7.5 not working with python 3.12.4 #13550
@Snawe

Description

@Snawe

How to reproduce the behaviour

  • Install spacy 3.7.5
  • Use Python 3.12.4
  • Run the example from the homepage
# pip install -U spacy
# python -m spacy download en_core_web_sm
import spacy

# Load English tokenizer, tagger, parser and NER
nlp = spacy.load("en_core_web_sm")

# Process whole documents
text = (
    "When Sebastian Thrun started working on self-driving cars at "
    "Google in 2007, few people outside of the company took him "
    "seriously. “I can tell you very senior CEOs of major American "
    "car companies would shake my hand and turn away because I wasn’t "
    "worth talking to,” said Thrun, in an interview with Recode earlier "
    "this week."
)
doc = nlp(text)

# Analyze syntax
print("Noun phrases:", [chunk.text for chunk in doc.noun_chunks])
print("Verbs:", [token.lemma_ for token in doc if token.pos_ == "VERB"])

# Find named entities, phrases and concepts
for entity in doc.ents:
    print(entity.text, entity.label_)

get the error:

ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
  File "/path/to/file.py", line 3, in <module>
    import spacy
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

The issue seems to be a pydantic issue and is already solved: pydantic/pydantic#9609

Your Environment

  • Operating System: Ubuntu
  • Python Version Used: 3.12.4
  • spaCy Version Used: 3.7.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0