Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'tracing_enabled' from 'langchain_core.tracers.context' (/usr/local/lib/python3.11/site-packages/langchain_core/tracers/context.py #15526

Closed
1 of 14 tasks
adarshkrpf opened this issue Jan 4, 2024 · 5 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@adarshkrpf
Copy link

System Info

0.0.352 and 0.0.353

Who can help?

No response

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

Custom _call wrapper

Expected behavior

No import error

Copy link

dosubot bot commented Jan 4, 2024

🤖

Hey @adarshkrpf! I'm Dosu, a friendly bot here to lend you a hand with your LangChain issues while we wait for the human maintainers. I can assist with debugging, answering queries, or guiding you on how to contribute to the project. Let's dive into solving things together!

Based on the context provided, it appears that the 'tracing_enabled' you're trying to import from 'langchain_core.tracers.context' does not exist in the LangChain versions 0.0.352 and 0.0.353. This is likely the cause of the ImportError you're encountering.

The closest match to 'tracing_enabled' in the provided context is the function 'tracing_v2_enabled'. If you intended to use this function, you should import 'tracing_v2_enabled' instead of 'tracing_enabled'.

If 'tracing_enabled' is indeed what you intended to import, it might be located in a different module or it might not exist at all. I recommend checking your code and the LangChain documentation for the correct import statement.

Unfortunately, I couldn't find any specific changes made to the 'langchain_core.tracers.context' module in the LangChain versions 0.0.352 and 0.0.353. It's possible that the 'tracing_enabled' was removed or renamed in these versions.

If you're still encountering issues, could you please provide more details about your custom _call wrapper and how you're using 'tracing_enabled'? This will help me understand your issue better and provide a more accurate solution.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jan 4, 2024
@Abdullahw72
Copy link

Facing same issue even though I did not change anything in my running code.

@xkaiDu
Copy link

xkaiDu commented Jan 4, 2024

Found the issue:
In commit 7eec8f2 the function tracing_enabled was deleted, see #15326

The commit itself handled the lingering dependencies correctly. however, the function deletion was included in langchain-core 0.1.5, and is being referred to by v0.0.353, which didn't clean up the dependencies yet, not until 0.0.354

I haven't tried yet, but upgrading to 0.0.354 should resolve the issue.
And 0.0.353 should have dependencies for langchain-core <=0.1.4

@baskaryan
Copy link
Collaborator

As @xkaiDu mentioned, this issue was caused by an incompatibility between older versions of langchain, meaning those <0.0.354, and langchain-core==0.1.5. If you have langchain>=0.0.354 this should not be an issue.

We've fixed this issue in langchain-core==0.1.6.

So to resolve, either:

  • Update langchain to >=0.0.354
  • Or, if you'd like to stay pinned to an older version of langchain, update just langchain-core to a version >=0.1.6

Closing issue, but if the above don't work for anyone please let us know!

@hwchase17
Copy link
Contributor

We've also yanked 0.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants