chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
13.36k stars 1.14k forks source link

[Install issue]: Not able to npm install because of Numpy 0.2.0 which has breaking change #2407

Closed spornthip closed 4 days ago

spornthip commented 5 days ago

What happened?

Seem like Numpy 0.2.0 has breaking change that is not compatible with chroma. Please refer to the log.

Can we restrict the version of numpy to < 0.2.0 ?

https://github.com/chroma-core/chroma/blob/release/0.4.24/requirements.txt#L9

Versions

ghcr.io/amikos-tech/chromadb-chart/chroma:0.4.24

Relevant log output

Collecting chroma-hnswlib
  Downloading chroma_hnswlib-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (252 bytes)
Collecting numpy (from chroma-hnswlib)
  Downloading numpy-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 5.2 MB/s eta 0:00:00
Downloading chroma_hnswlib-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 52.4 MB/s eta 0:00:00
Downloading numpy-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.3/19.3 MB 117.9 MB/s eta 0:00:00
Installing collected packages: numpy, chroma-hnswlib
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Uninstalling numpy-1.26.4:
      Successfully uninstalled numpy-1.26.4
  Attempting uninstall: chroma-hnswlib
    Found existing installation: chroma-hnswlib 0.7.3
    Uninstalling chroma-hnswlib-0.7.3:
      Successfully uninstalled chroma-hnswlib-0.7.3
Successfully installed chroma-hnswlib-0.7.3 numpy-2.0.0

[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: pip install --upgrade pip
/chroma/./chromadb/utils/embedding_functions.py:584: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self._task_type is "RETRIEVAL_DOCUMENT":
Traceback (most recent call last):
  File "/chroma/venv/bin/uvicorn", line 8, in <module>
    sys.exit(main())
  File "/chroma/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/chroma/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/chroma/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/chroma/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/main.py", line 408, in main
    run(
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/main.py", line 576, in run
    server.run()
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
    config.load()
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
    self.loaded_app = import_from_string(self.app)
  File "/chroma/venv/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
    module = importlib.import_module(module_str)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/chroma/./chromadb/__init__.py", line 3, in <module>
    from chromadb.api.client import Client as ClientCreator
  File "/chroma/./chromadb/api/__init__.py", line 7, in <module>
    from chromadb.api.models.Collection import Collection
  File "/chroma/./chromadb/api/models/Collection.py", line 7, in <module>
    import chromadb.utils.embedding_functions as ef
  File "/chroma/./chromadb/utils/embedding_functions.py", line 3, in <module>
    from chromadb.api.types import (
  File "/chroma/./chromadb/api/types.py", line 101, in <module>
    ImageDType = Union[np.uint, np.int_, np.float_]
  File "/chroma/venv/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.. Did you mean: 'float16'?
jeffchuber commented 5 days ago

@spornthip please checkout this issue https://github.com/chroma-core/chroma/issues/2358

and this PR https://github.com/chroma-core/chroma/pull/2360

I think you may just need to update Chroma.

startakovsky commented 4 days ago

I am getting this error when I import but I think it's llama-index-vector-stores-chroma because I just installed everything from scratch


chroma-hnswlib==0.7.3
chromadb==0.5.3
llama-index-vector-stores-chroma==0.1.9```
spornthip commented 4 days ago

@jeffchuber what is the version that I should update to?

spornthip commented 4 days ago

@jeffchuber Updated to 0.5.2 and it's working now thanks