Skip to content

ImportError: cannot import name 'GetCoreSchemaHandler' from 'pydantic' while using presidio-analyzer #1567

Open
@usman61

Description

@usman61

I am getting the import error while using presidio-analyzer in my databricks notebook.

given below is the basic getting started code for presidio-analyzer. surprisingly, it works on my local machine.
I have python 3.11 and tried with several versions of presidio-analyzer and pydantic but nothing works.

_pip install presidio-analyzer_

from presidio_analyzer import AnalyzerEngine

analyzer = AnalyzerEngine()

results = analyzer.analyze(text="My phone number is 212-555-5555",
                           entities=["PHONE_NUMBER"],
                           language='en')
print(results)

Image

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