-
Couldn't load subscription status.
- Fork 566
Closed
Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.35.1, 2.37.0
Steps to Reproduce
#4678 has introduced changes that made langchain package required to be installed in order to use LangchainIntegration whereas previously only the langchain-core was required. The integration, however, uses langchain package only to wrap the AgentExecutor methods, which is anyway optional.
- create a project with
langchain-coreandsentry-sdkpackages - run
sentry_sdk.integrations.langchain - See
DidNotEnable("langchain not installed")exception
Or just run this command
uv run --with "sentry-sdk" --with "langchain-core" python -c "import sentry_sdk.integrations.langchain"Expected Result
When langchain package is not installed it just skips wrapping AgentExecutor methods in setup_once if langchain package is not present
Actual Result
Traceback (most recent call last):
File "/Users/user/.cache/uv/archive-v0/LbXO3QDNdb9rlVPdSE8LR/lib/python3.12/site-packages/sentry_sdk/integrations/langchain.py", line 32, in <module>
from langchain.agents import AgentExecutor
ModuleNotFoundError: No module named 'langchain'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/user/.cache/uv/archive-v0/LbXO3QDNdb9rlVPdSE8LR/lib/python3.12/site-packages/sentry_sdk/integrations/langchain.py", line 44, in <module>
raise DidNotEnable("langchain not installed")
sentry_sdk.integrations.DidNotEnable: langchain not installed
Metadata
Metadata
Assignees
Projects
Status
No status