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-chroma depends on numpy (>=1.26.2,<2.0.0) #30555

Closed
5 tasks done
ahenawy opened this issue Mar 30, 2025 · 3 comments · Fixed by #30714
Closed
5 tasks done

langchain-chroma depends on numpy (>=1.26.2,<2.0.0) #30555

ahenawy opened this issue Mar 30, 2025 · 3 comments · Fixed by #30714
Assignees
Labels
investigate Flagged for investigation.

Comments

@ahenawy
Copy link

ahenawy commented Mar 30, 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

def retriever_tool():
    """
    Consult the company policies to check whether certain options are permitted.
    """
    vectorstore = Chroma(
        embedding_function=AzureOpenAIEmbeddings(deployment=os.environ["EMBEDDING_DEPLOYMENT_NAME"], chunk_size=1),
        collection_name="local-rag",
        persist_directory=os.environ["DATA_STORAGE"],
        client_settings=Settings(anonymized_telemetry=False, is_persistent=True),
    )
    retriever = vectorstore.as_retriever(search_type="similarity", search_kwargs={"k": 3})
    return create_retriever_tool(
        retriever,
        "docs_retriever",
        "Get information about pcfc roles and responsibilities policy and regulations",
    )

Error Message and Stack Trace (if applicable)

No response

Description

The current version of langchain-chroma (0.2.2) specifies a dependency on numpy>=1.26.2,<2.0.0. This constraint conflicts with other packages that require numpy>=2.0.0 or higher, causing version resolution failures in projects that depend on both. For example, a project using langchain-chroma (>=0.2.2,<0.3.0) alongside another package needing a newer numpy version cannot resolve dependencies. Could the upper bound on numpy be relaxed to >=2.0.2 in a future release to improve compatibility?

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
Python Version: 3.12.9 (main, Feb 4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]

Package Information

langchain_core: 0.3.49
langchain: 0.3.21
langchain_community: 0.3.20
langsmith: 0.3.19
langchain_chroma: 0.2.2
langchain_experimental: 0.3.4
langchain_google_community: 2.0.7
langchain_openai: 0.3.11
langchain_text_splitters: 0.3.7
langchainhub: 0.1.21
langgraph_sdk: 0.1.60

Optional packages not installed

langserve

@langcarl langcarl bot added the investigate Flagged for investigation. label Mar 30, 2025
@ahenawy
Copy link
Author

ahenawy commented Apr 1, 2025

Could langchain-chroma be updated in a future release to support numpy>=2.0.2, given the current restriction to <2.0.0 causes conflicts with packages needing newer numpy versions?

@sydney-runkle sydney-runkle self-assigned this Apr 7, 2025
@sydney-runkle
Copy link
Collaborator

Hi @ahenawy,

Thanks for the report - yes, I'm working on a fix in #30714 :)

@sydney-runkle
Copy link
Collaborator

Ah actually, going to close this as a dupe of #29467, but we'll still fix via the above PR :)

sydney-runkle added a commit that referenced this issue Apr 8, 2025
#30714)

Generally, this PR is CI performance focused + aims to clean up some
dependencies at the same time.

1. Unpins upper bounds for `numpy` in all `pyproject.toml` files where
`numpy` is specified
2. Requires `numpy >= 2.1.0` for Python 3.13 and `numpy > v1.26.0` for
Python 3.12, plus a `numpy` min version bump for `chroma`
3. Speeds up CI by minutes - linting on Python 3.13, installing `numpy <
2.1.0` was taking [~3
minutes](https://github.com/langchain-ai/langchain/actions/runs/14316342925/job/40123305868?pr=30713),
now the entire env setup takes a few seconds
4. Deleted the `numpy` test dependency from partners where that was not
used, specifically `huggingface`, `voyageai`, `xai`, and `nomic`.

It's a bit unfortunate that `langchain-community` depends on `numpy`, we
might want to try to fix that in the future...

Closes #26026
Fixes #30555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Flagged for investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants