Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

[Bug]: incompatible imports between latest llama_hub and latest llama_index downloaded via pip + pypi #955

@aaronjolson

Description

@aaronjolson

Bug Description

I am trying to work through a script for indexing a github repo. I determined that the script was written for an earlier version of llama_index (pre 0.10) I thought I would try and bring it up to date with the latest version of llama_index and llama_hub.
I installed both llama-index and llama-hub via pip and pypi

This is the pip freeze of my llama deps

llama-hub==0.0.79.post1
llama-index==0.10.6
llama-index-agent-openai==0.1.1
llama-index-core==0.10.6.post1
llama-index-embeddings-openai==0.1.1
llama-index-legacy==0.9.48
llama-index-llms-openai==0.1.2
llama-index-multi-modal-llms-openai==0.1.1
llama-index-program-openai==0.1.2
llama-index-question-gen-openai==0.1.1
llama-index-readers-file==0.1.3
llamaindex-py-client==0.1.12

These are the imports at the top of my script ( and the place where my script is erroring)

import os
import textwrap
from dotenv import load_dotenv
from llama_index.legacy import download_loader
from llama_hub.github_repo import GithubRepositoryReader, GithubClient
from llama_index.core import VectorStoreIndex
from llama_index.legacy.vector_stores import DeepLakeVectorStore
from llama_index.core.storage.storage_context import StorageContext
import re

This is the error I am getting

Traceback (most recent call last):
  File "C:\Users\aaols\PycharmProjects\experiments\llamaindex_activeloop_vectorize_data_from_github.py", line 12, in <module>
    from llama_hub.github_repo import GithubRepositoryReader, GithubClient
  File "C:\Users\aaols\PycharmProjects\experiments\venv\lib\site-packages\llama_hub\github_repo\__init__.py", line 2, in <module>
    from llama_hub.github_repo.base import (
  File "C:\Users\aaols\PycharmProjects\experiments\venv\lib\site-packages\llama_hub\github_repo\base.py", line 18, in <module>
    from llama_index.readers.base import BaseReader
ModuleNotFoundError: No module named 'llama_index.readers.base'

which looks like the latest version of llama_hub in pypi is not yet aware of the changes in llama_index.
This is a case where llama_hub relies on a specific version (or range of versions) of llama_index and this should really be called out in the deps. https://github.com/run-llama/llama-hub/blob/main/pyproject.toml#L19
Should likely be changed to
llama-index = ">=0.9.41, <0.10.0"
as llama-index is a dependency of llama-hub, and if this is a known place of incompatibility, this should be called out in the pyproject.toml

Version

0.10.6

Steps to Reproduce

install the same versions of llama-index and llama-hub as noted above

Relevant Logs/Tracbacks

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions