agiresearch / AIOS

AIOS: LLM Agent Operating System
https://aios.foundation
MIT License
3.42k stars 409 forks source link

[bug] np.float_ was removed in numpy 2.0 #324

Closed om-raheja closed 2 hours ago

om-raheja commented 2 hours ago

I can fix this because it is just a matter of renaming due to deprecation. However, I want to verify this is a bug and not an issue on my end first.

To reproduce: (technically, steps 2 and 3 are not necessary but just in case it helps reproducing the bug)

  1. use python3.11 to install everything in requirements-dev.txt
  2. run python3.11 -m pip install --force-reinstall llama-index-core==0.10.41 protobuf==3.19.0 opentelemetry-proto==1.25.0 (i only did this because of my prior conflicts that got resolved)
  3. run python3.11 -m pip install --force-reinstall langchain-core==0.1.43 numpy==1.26.4 chromadb==0.4.23 protobuf==5.26.1 llama-index-core==0.10.36
  4. run either launch.py or main.py with python3.11 main.py
(venv) ➜  AIOS git:(main) python3.11 main.py
Traceback (most recent call last):
  File "/Users/omraheja/git/AIOS/main.py", line 10, in <module>
    from aios.hooks.starter import aios_starter
  File "/Users/omraheja/git/AIOS/aios/hooks/starter.py", line 5, in <module>
    from .modules.storage import useStorageManager
  File "/Users/omraheja/git/AIOS/aios/hooks/modules/storage.py", line 11, in <module>
    from aios.storage.storage import StorageManager
  File "/Users/omraheja/git/AIOS/aios/storage/storage.py", line 7, in <module>
    from .storage_classes.db_storage import ChromaDB
  File "/Users/omraheja/git/AIOS/aios/storage/storage_classes/db_storage.py", line 1, in <module>
    from chromadb.config import Settings
  File "/opt/homebrew/lib/python3.11/site-packages/chromadb/__init__.py", line 3, in <module>
    from chromadb.api.client import Client as ClientCreator
  File "/opt/homebrew/lib/python3.11/site-packages/chromadb/api/__init__.py", line 7, in <module>
    from chromadb.api.models.Collection import Collection
  File "/opt/homebrew/lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 7, in <module>
    import chromadb.utils.embedding_functions as ef
  File "/opt/homebrew/lib/python3.11/site-packages/chromadb/utils/embedding_functions.py", line 7, in <module>
    from chromadb.api.types import (
  File "/opt/homebrew/lib/python3.11/site-packages/chromadb/api/types.py", line 102, in <module>
    ImageDType = Union[np.uint, np.int_, np.float_]
                                         ^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.
(venv) ➜  AIOS git:(main)
BRama10 commented 2 hours ago

@om-raheja can you reproduce on 3.10 as well?

BRama10 commented 2 hours ago

also this is a chromadb issue on brew so no issue... I'd assume they keep using float_ due to backward compat