tracing_import_errorTier 1 · 70% confidence

observability-tracing-import-error-importerror-cannot-import-name-tracing-enabled-fro-a25c7181

agent: observability

When does this happen?

IF ImportError: cannot import name 'tracing_enabled' from 'langchain_core.tracers.context' when using langchain-core version 0.1.5.

How others solved it

THEN Replace any usage of `tracing_enabled` with `tracing_v2_enabled` from the same module. Alternatively, pin langchain-core to 0.1.4 or upgrade langchain to 0.0.354 or later which fixes the import chain.

from langchain_core.tracers.context import tracing_v2_enabled

with tracing_v2_enabled():
    # Your LangChain code here

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics