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

can not install langchain when docling is installed #28283

Open
5 tasks done
ryotaro-ikeda0 opened this issue Nov 22, 2024 · 1 comment
Open
5 tasks done

can not install langchain when docling is installed #28283

ryotaro-ikeda0 opened this issue Nov 22, 2024 · 1 comment

Comments

@ryotaro-ikeda0
Copy link

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

poetry add docling==0.2.7 langchain=0.3.1

Error Message and Stack Trace (if applicable)

Because no versions of langchain match >0.3.7,<0.4.0
and langchain (0.3.7) depends on numpy (>=1.26.0,<2.0.0), langchain (>=0.3.7,<0.4.0) requires numpy (>=1.26.0,<2.0.0).
Because deepsearch-glm (0.26.1) depends on numpy (>=2.0.2,<3.0.0)
and no versions of deepsearch-glm match >0.26.1,<0.27.0, deepsearch-glm (>=0.26.1,<0.27.0) requires numpy (>=2.0.2,<3.0.0).
Thus, langchain (>=0.3.7,<0.4.0) is incompatible with deepsearch-glm (>=0.26.1,<0.27.0).
And because docling (2.7.0) depends on deepsearch-glm (>=0.26.1,<0.27.0)
and no versions of docling match >2.7.0,<3.0.0, langchain (>=0.3.7,<0.4.0) is incompatible with docling (>=2.7.0,<3.0.0).
So, because nick-ai-batch depends on both docling (^2.7.0) and langchain (^0.3.7), version solving failed.

Description

I would like to install docling and langchain simultaneously:

$ poetry add docling langchain

However, the following error occurs:

Because no versions of langchain match >0.3.7,<0.4.0
 and langchain (0.3.7) depends on numpy (>=1.26.0,<2.0.0), langchain (>=0.3.7,<0.4.0) requires numpy (>=1.26.0,<2.0.0).
Because deepsearch-glm (0.26.1) depends on numpy (>=2.0.2,<3.0.0)
 and no versions of deepsearch-glm match >0.26.1,<0.27.0, deepsearch-glm (>=0.26.1,<0.27.0) requires numpy (>=2.0.2,<3.0.0).
Thus, langchain (>=0.3.7,<0.4.0) is incompatible with deepsearch-glm (>=0.26.1,<0.27.0).
And because docling (2.7.0) depends on deepsearch-glm (>=0.26.1,<0.27.0)
 and no versions of docling match >2.7.0,<3.0.0, langchain (>=0.3.7,<0.4.0) is incompatible with docling (>=2.7.0,<3.0.0).
So, because nick-ai-batch depends on both docling (^2.7.0) and langchain (^0.3.7), version solving failed.

When I check the numpy version requirements for deepsearch-glm (a dependency of docling), it is defined as follows:

$ poetry show deepsearch-glm --tree | grep numpy

>>>
│   ├── numpy >=2.0.2,<3.0.0 (circular dependency aborted here)
│   ├── numpy >=1.26.4,<2.0.0 (circular dependency aborted here)

However, for langchain, its dependency on numpy does not seem to handle circular dependency:

$ poetry show langchain --tree | grep numpy

>>>
├── numpy >=1.26.0,<2.0.0

On the other hand, if I install llama-index, it succeeds. Checking its dependency definitions for numpy, it seems to handle circular dependencies:

$ poetry show llama-index --tree | grep numpy

>>>
│   │   ├── numpy * 
│   │   ├── numpy * 
│   ├── numpy * 
│   │   ├── numpy * 
│       ├── numpy * 
│   ├── numpy * 
│   │   ├── numpy >=1.26.0 (circular dependency aborted here)
│   │   ├── numpy * 
│   │   ├── numpy * 
│   │   │   ├── numpy * 
│   │   ├── numpy * 
│   │   ├── numpy * 
│   │   ├── numpy >=1.26.0 (circular dependency aborted here)
│   │   ├── numpy * 

Would it be possible to address the circular dependency in langchain similarly?

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
Python Version: 3.12.7 (main, Nov 18 2024, 16:51:48) [Clang 15.0.0 (clang-1500.3.9.4)]

Package Information

langchain_core: 0.3.19
langsmith: 0.1.144

Optional packages not installed

langgraph
langserve

Other Dependencies

httpx: 0.27.2
jsonpatch: 1.33
orjson: 3.10.11
packaging: 24.2
pydantic: 2.9.2
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
tenacity: 8.5.0
typing-extensions: 4.12.2

@langcarl langcarl bot added the investigate label Nov 22, 2024
@vagenas
Copy link

vagenas commented Nov 22, 2024

@ryotaro-ikeda0 for a workaround check out this comment:
DS4SD/docling#283 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants