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

langchain_community is missing a dependency #29121

Closed
5 tasks done
stevegrubb opened this issue Jan 10, 2025 · 1 comment
Closed
5 tasks done

langchain_community is missing a dependency #29121

stevegrubb opened this issue Jan 10, 2025 · 1 comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature investigate Flagged for investigation.

Comments

@stevegrubb
Copy link

stevegrubb commented Jan 10, 2025

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

pip show langchain_community | grep Requires

Error Message and Stack Trace (if applicable)

No response

Description

langchain_community has a dependency on unstructured that is not captured. If you look at the document_loaders/unstructured.py file, you will see several imports of unstructured. It is not captured in the dependencies:

$ pip3 show langchain_community | grep Requires
Requires: SQLAlchemy, langsmith, PyYAML, dataclasses-json, tenacity, langchain-core, langchain, numpy, aiohttp, requests

Even though the system info below is RHEL 8 era, the current code shows poetry.lock does not have unstructured listed anywhere. This causes crashes on downloads.

System Info

System Information

OS: Linux
OS Version: #1 SMP PREEMPT_DYNAMIC Sun Nov 17 18:52:19 UTC 2024
Python Version: 3.9.20 (main, Sep 26 2024, 20:59:47)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-22)]

Package Information

langchain_core: 0.2.43
langchain: 0.2.9
langchain_community: 0.2.9
langsmith: 0.1.147
langchain_text_splitters: 0.2.4

Optional packages not installed

langgraph
langserve

Other Dependencies

aiohttp: 3.11.11
async-timeout: 4.0.3
dataclasses-json: 0.6.7
httpx: 0.28.1
jsonpatch: 1.33
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.4
orjson: 3.10.14
packaging: 24.2
pydantic: 2.10.4
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.36
tenacity: 8.5.0
typing-extensions: 4.12.2

@langcarl langcarl bot added the investigate Flagged for investigation. label Jan 10, 2025
@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jan 10, 2025
@ccurme
Copy link
Collaborator

ccurme commented Jan 10, 2025

unstructured and almost all other third party integration dependencies are deliberately omitted from the explicit dependencies of langchain-community. They are often not imported until a class is instantiated and we make an effort to raise an informative error message when missing. Due to the number of integrations in langchain-community, it would not be practical to manage all their dependencies simultaneously.

To mitigate this, we recommend new integrations be implemented as separate packages. There is an existing package for langchain-unstructured that explicitly depends on unstructured. This package is recommended over the abstractions in langchain-community.

@ccurme ccurme closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
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 investigate Flagged for investigation.
Projects
None yet
Development

No branches or pull requests

2 participants