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

Error Installing docling (>=2.4.1,<3.0.0) in project with langchain dependency #283

Closed
souzatharsis opened this issue Nov 8, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@souzatharsis
Copy link

Bug

Installing docling (>=2.4.1,<3.0.0) in a project with langchain (any version) dependency fails.

  1. Because langchain depends on numpy (>=1.26.0,<2.0.0)
  2. Because cocling (>=2.4.1,<3.0.0) requires numpy (>=2.0.2,<3.0.0)

So, because my project depends on both langchain (^0.3.3) and numpy (>=2.0.2,<3.0.0), version solving failed.

Steps to reproduce

poetry add langchain
poetry add docling

Docling version

(>=2.4.1,<3.0.0)

Python version

Python 3.11

@souzatharsis souzatharsis added the bug Something isn't working label Nov 8, 2024
@souzatharsis
Copy link
Author

Is there a way we can use docling with numpy (>=1.26.0,<2.0.0) while langchain does not upgrade to numpy (>=2.0.0) to enable docling/langchain integration?

@souzatharsis
Copy link
Author

same with langchain-community

@vagenas vagenas self-assigned this Nov 8, 2024
@souzatharsis
Copy link
Author

Since docling for content generation for llms is an important use case
Since langchain is the most used llm framework today
We would love your help in solving this critical issue.

Thanks!

@vagenas
Copy link
Contributor

vagenas commented Nov 8, 2024

@souzatharsis,

TLDR:
Check if Python 3.13 is among the Python versions allowed by your pyproject.toml and if so, remove it and try again.
E.g., if you have python = "^3.10", use python = ">=3.10,<3.13" instead.

Details:
Numpy is only adding Python 3.13 support starting in some 2.x.y version. In order to prepare for 3.13, Docling depends on a 2.x.y for 3.13, otherwise depending an 1.x.y version (source). If you are allowing 3.13 in your pyproject.toml, Poetry will try to find some way to reconcile Docling's numpy version for 3.13 (some 2.x.y) with LangChain's version for that (some 1.x.y) — leading to the error above.

Let me know if that helped.

👉 Also keep an eye on our recent LangChain PR: we expect to have native LangChain support very soon 😉

@souzatharsis
Copy link
Author

Thank you so much; that resolved the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants