run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
33.39k stars 4.67k forks source link

[Bug]: llama-index-embeddings-google and llama-index-vector-stores-google need package bump. #12811

Open gich2009 opened 2 months ago

gich2009 commented 2 months ago

Bug Description

llama-index-embeddings-google and llama-index-vector-stores-google depend on google-generativeai<0.4.0 and >=0.3.2

Whereas llama-index-embeddings-gemini 0.1.6 depends on google-generativeai<0.5.0 and >=0.4.1 llama-index-llms-gemini 0.1.7 depends on google-generativeai<0.5.0 and >=0.4.1 llama-index-llms-palm 0.1.5 depends on google-generativeai<0.5.0 and >=0.4.1 llama-index-multi-modal-llms-gemini 0.1.5 depends on google-generativeai<0.5.0 and >=0.4.1

This causes an issue with the pip resolver

Version

llama-index-vector-stores-google 0.1.5 and llama-index-embeddings-google 0.1.4

Steps to Reproduce

Just installl the latest packages for vector-stores-google and embeddings-google

Relevant Logs/Tracbacks

ERROR: Cannot install -r requirements-lock.txt (line 102), -r requirements-lock.txt (line 105), -r requirements-lock.txt (line 87), -r requirements-lock.txt (line 95), google-generativeai==0.4.1 and llama-index-vector-stores-google==0.1.5 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested google-generativeai==0.4.1
    llama-index-embeddings-gemini 0.1.6 depends on google-generativeai<0.5.0 and >=0.4.1
    llama-index-llms-gemini 0.1.7 depends on google-generativeai<0.5.0 and >=0.4.1
    llama-index-llms-palm 0.1.5 depends on google-generativeai<0.5.0 and >=0.4.1
    llama-index-multi-modal-llms-gemini 0.1.5 depends on google-generativeai<0.5.0 and >=0.4.1
    llama-index-vector-stores-google 0.1.5 depends on google-generativeai<0.4.0 and >=0.3.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
dosubot[bot] commented 2 months ago

To address the dependency conflict issue you're encountering with llama-index-vector-stores-google and llama-index-embeddings-google due to google-generativeai version constraints, you can try the following steps:

  1. Update pip to the latest version to improve dependency resolution:

    pip install --upgrade pip
  2. Consider using Anaconda for managing packages and dependencies, which might resolve conflicts that pip struggles with. Anaconda can be downloaded from here.

  3. Manually adjust version constraints in your environment. This involves either loosening the range of package versions specified or removing specific package versions to allow pip to attempt to solve the dependency conflict.

If using Poetry, you can override the version of google-generativeai to a specific version that is compatible with all your packages by adding an overrides section in your pyproject.toml:

[tool.poetry.overrides]
"google-generativeai" = "0.4.3"

Then, run poetry update to apply the changes.

Ensure to test your application thoroughly after making these adjustments to confirm there are no runtime issues with the new setup.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
logan-markewich commented 2 months ago

@gich2009 I'm unable to test googles services. If you cam test that the latest Google packages do not break things for vector-stores-google, and make a PR, that would be extremely appreciated

gich2009 commented 2 months ago

Alright @logan-markewich. Will take a look when I get the chance.