Find answers from the community

Updated 7 months ago

can someone help us with finding the

can someone help us with finding the updated module names/directories for:
Plain Text
from llama_index import download_loader
from llama_hub.github_repo import GithubRepositoryReader, GithubClient
from llama_index import VectorStoreIndex
from llama_index.vector_stores import DeepLakeVectorStore
from llama_index.storage.storage_context import StorageContext 
L
R
20 comments
These are all outdated imports, not sure where you got these from
All our documentation is updated with proper import and installs

In v0.10.x, we split every integration into its own python package
I can rewrite this:
hi Logan, we got this from the "ActiveLoop" course on Advanced RAG with LlamaIndex
we wanted to learn more about LlamaIndex and thought this course (seemed new!) would be a good start
pip install llama-index llama-index-readers-github llama-index-vector-stores-deeplake

Plain Text
from llama_index.readers.github import GithubRepositoryReader, GithubClient
from llama_index.core import VectorStoreIndex, StorageContext
from llama_index.vector_stores.deeplake import DeepLakeVectorStore
when in doubt, our docs are the best place to start πŸ™‚
thank you Logan! We will start again and check in later today. Is there a specific DOC that has all the up-to-date Directories/Imports ? it would be very useful for all those people watching outdated content.
Error: TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
Attachment
Discord_0qMwa7pevI.png
ah yes, so python 3.12.4 is borked
plz try 3.12.2 or older for now
fyi, I have sent a message to the ActiveLoop team to update their codebases to match the new imports.

*Update: unfortunately I am getting the same error on Python 3.10.14
Plain Text
 ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 1
----> 1 from llama_index.core import VectorStoreIndex
      2 from llama_index.readers.github import GithubRepositoryReader, GithubClient
      3 from IPython.display import Markdown, display

File c:\Projects\activeloop\repo-ai\Lib\site-packages\llama_index\core\__init__.py:10
      7 from typing import Callable, Optional
      9 # response
---> 10 from llama_index.core.base.response.schema import Response
     12 # import global eval handler
     13 from llama_index.core.callbacks.global_handlers import set_global_handler

File c:\Projects\activeloop\repo-ai\Lib\site-packages\llama_index\core\base\response\schema.py:7
      4 from dataclasses import dataclass, field
      5 from typing import Any, Dict, List, Optional, Union
----> 7 from llama_index.core.async_utils import asyncio_run
      8 from llama_index.core.bridge.pydantic import BaseModel
      9 from llama_index.core.schema import NodeWithScore

File c:\Projects\activeloop\repo-ai\Lib\site-packages\llama_index\core\async_utils.py:7
      4 from itertools import zip_longest
      5 from typing import Any, Coroutine, Iterable, List, Optional, TypeVar
----> 7 import llama_index.core.instrumentation as instrument
      9 dispatcher = instrument.get_dispatcher(__name__)
     12 def asyncio_module(show_progress: bool = False) -> Any:

File c:\Projects\activeloop\repo-ai\Lib\site-packages\llama_index\core\instrumentation\__init__.py:1
----> 1 from llama_index.core.instrumentation.dispatcher import Dispatcher, Manager
      2 from llama_index.core.instrumentation.event_handlers import NullEventHandler
      3 from llama_index.core.instrumentation.span_handlers import NullSpanHandler

File c:\Projects\activeloop\repo-ai\Lib\site-packages\llama_index\core\instrumentation\dispatcher.py:24
     20     def __call__(self, event: BaseEvent, **kwargs) -> None:
     21         ...
---> 24 class Dispatcher(BaseModel):
     25     """Dispatcher class.
     26 
     27     Responsible for dispatching BaseEvent (and its subclasses) as well as
   (...)
     36         hierarchy.
     37     """
     39     name: str = Field(default_factory=str, description="Name of dispatcher")

File c:\Projects\activeloop\repo-ai\Lib\site-packages\pydantic\v1\main.py:286, in ModelMetaclass.__new__(mcs, name, bases, namespace, **kwargs)
    284 cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
    285 if resolve_forward_refs:
--> 286     cls.__try_update_forward_refs__()
    288 # preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487
    289 # for attributes not in `new_namespace` (e.g. private attributes)
    290 for name, obj in namespace.items():

File c:\Projects\activeloop\repo-ai\Lib\site-packages\pydantic\v1\main.py:807, in BaseModel.__try_update_forward_refs__(cls, **localns)
    801 @classmethod
...
     64     # Even though it is the right signature for python 3.9, mypy complains with
     65     # `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast...
---> 66     return cast(Any, type_)._evaluate(globalns, localns, set())

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
mmmm thats pretty sus, it worked for others πŸ€” I wonder if its also a pydnatic version issue as well
pip install -U pyndantic not sure if latest will help

Or downgrading slightly, like pip install pyndatic==2.6.3
It looks like you might be in a notebook as well, I'd double check that you have the correct venv set (and that you restarted the notebook after installing anything)
yes I'm not certain what is going on but I appreciate the help:
  • I have tried running several (venv) environments including Conda (python 3.10.4 and up): all gave the same errors when trying to load in llama dependencies.
Plain Text
from pydantic import BaseModel
from llama_index.core import download_loader

Traceback (most recent call last):
File "c:\Projects\activeloop\test.py", line 2, in <module>
from llama_index.core import download_loader
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\llama_index\core__init.py", line 10, in <module> from llama_index.core.base.response.schema import Response File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\llama_index\core\base\response\schema.py", line 7, in <module> from llama_index.core.async_utils import asyncio_run File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\llama_index\core\async_utils.py", line 7, in <module> import llama_index.core.instrumentation as instrument File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\llama_index\core\instrumentation__init.py", line 1, in <module>
from llama_index.core.instrumentation.dispatcher import Dispatcher, Manager
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\llama_index\core\instrumentation\dispatcher.py", line 24, in <module>
class Dispatcher(BaseModel):
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pydantic\v1\main.py", line 286, in new
cls.try_update_forward_refs()
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pydantic\v1\main.py", line 808, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pydantic\v1\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pydantic\v1\typing.py", line 520, in update_field_forwardrefs field.type = evaluateforwardref(field.type, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aidoj\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pydantic\v1\typing.py", line 66, in evaluateforwardref return cast(Any, type)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
tomorrow I will try a fresh install on a different PC to see if its an issue on my end. I think its because python 3.12 is installed Globally which some libraries are reverting to use despite being in a (venv) for Python 3.10.4

It seems like a circular dependency issue:
Plain Text
ImportError: cannot import name 'BaseQueryEngine' from partially initialized module 'llama_index.core' (most likely due to a circular import) (c:\Projects\LangChainCrashCourse\.venv\Lib\site-packages\llama_index\core\__init__.py

Haven't been able to solive it ..yet!
Hmm, I can't say seen that before (our cicd would have picked that up I hope)
Add a reply
Sign up and join the conversation on Discord