Skip to content

ModuleNotFoundError after release logfire 4.3.0Β #2516

@alexon1234

Description

@alexon1234

Initial Checks

Description

We started to get ModuleNotFoundError after the logfire 4.3.0 was release pydantic/logfire#1308

  File "packages/pydantic_ai/__init__.py", line 3, in <module>
    from .agent import Agent, CallToolsNode, EndStrategy, ModelRequestNode, UserPromptNode, capture_run_messages
  File "packages/pydantic_ai/agent.py", line 19, in <module>
    from pydantic_graph import End, Graph, GraphRun, GraphRunContext
  File "packages/pydantic_graph/__init__.py", line 2, in <module>
    from .graph import Graph, GraphRun, GraphRunResult
  File "packages/pydantic_graph/graph.py", line 11, in <module>
    import logfire_api
  File "packages/logfire_api/__init__.py", line 8, in <module>
    from opentelemetry.sdk.trace import ReadableSpan
ModuleNotFoundError: No module named 'opentelemetry.sdk'

Pinging the dependency to 4.2.0 fixed the issue

Example Code

Python, Pydantic AI & LLM client version

Python 3.11
pydantic                      2.11.7
pydantic-ai-slim              0.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions