run-llama / create-llama

The easiest way to get started with LlamaIndex
MIT License
932 stars 117 forks source link

Poetry Dependency issues with Vector Databases and Fastapi Backend #299

Closed lumalik closed 1 month ago

lumalik commented 1 month ago

When selecting a Vector Database with Fastapi Backend I receive a poetry dependency error. With just in memory storage there is no error. I also get an error for Chroma DB and Qdrant.

The error:

Initializing Python project with template: streaming 

No tools selected - use optimized context chat engine

Adding additional dependencies
Adding tools dependencies

Added llama-index-vector-stores-postgres, llama-index-readers-web, llama-index-llms-openai, llama-index-embeddings-openai, llama-index-agent-openai, traceloop-sdk to pyproject.toml

Installing python dependencies using poetry. This may take a while...
Updating dependencies
Resolving dependencies... (9.2s)

The current project's supported Python range (>=3.11,<4.0) is not compatible with some of the required packages Python requirement:
  - llama-index-vector-stores-postgres requires Python >=3.8.1,<3.12, so it will not be satisfied for Python >=3.12,<4.0

Because no versions of llama-index-vector-stores-postgres match >0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.1.13 || >0.1.13,<0.1.14 || >0.1.14,<0.2.0
 and llama-index-vector-stores-postgres (0.1.1) requires Python >=3.8.1,<3.12, llama-index-vector-stores-postgres is forbidden.
And because llama-index-vector-stores-postgres (0.1.2) depends on llama-index-core (>=0.10.1,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.1.13 || >0.1.13,<0.1.14 || >0.1.14,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.14) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.13) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.12) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.11) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.10) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.9) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.7) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.6) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.5) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.4.post1) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.3) depends on llama-index-core (>=0.10.1,<0.11.0)
 and llama-index (0.11.6) depends on llama-index-core (>=0.11.6,<0.12.0), llama-index (0.11.6) is incompatible with llama-index-vector-stores-postgres (>=0.1.1,<0.2.0).
So, because app depends on both llama-index (0.11.6) and llama-index-vector-stores-postgres (^0.1.1), version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    For llama-index-vector-stores-postgres, a possible solution would be to set the `python` property to ">=3.11,<3.12"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
Installing dependencies using poetry failed. Please check error log above and try running create-llama again.

Changing the python property as suggested does not resolve the issue and leads to error:

Because no versions of llama-index-vector-stores-postgres match >0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.1.13 || >0.1.13,<0.1.14 || >0.1.14,<0.2.0
 and llama-index-vector-stores-postgres (0.1.1) depends on llama-index-core (>=0.10.1,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.1.13 || >0.1.13,<0.1.14 || >0.1.14,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.2) depends on llama-index-core (>=0.10.1,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.1.13 || >0.1.13,<0.1.14 || >0.1.14,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.14) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.13) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.1.11 || >0.1.11,<0.1.12 || >0.1.12,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.12) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.11) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.1.9 || >0.1.9,<0.1.10 || >0.1.10,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.10) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.9) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.1.6 || >0.1.6,<0.1.7 || >0.1.7,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.7) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.6) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.1.4.post1 || >0.1.4.post1,<0.1.5 || >0.1.5,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.5) depends on llama-index-core (>=0.10.20,<0.11.0)
 and llama-index-vector-stores-postgres (0.1.4.post1) depends on llama-index-core (>=0.10.20,<0.11.0), llama-index-vector-stores-postgres (>=0.1.1,<0.1.3 || >0.1.3,<0.2.0) requires llama-index-core (>=0.10.1,<0.11.0).
And because llama-index-vector-stores-postgres (0.1.3) depends on llama-index-core (>=0.10.1,<0.11.0)
 and llama-index (0.11.6) depends on llama-index-core (>=0.11.6,<0.12.0), llama-index (0.11.6) is incompatible with llama-index-vector-stores-postgres (>=0.1.1,<0.2.0).
So, because app depends on both llama-index (0.11.6) and llama-index-vector-stores-postgres (^0.1.1), version solving failed.

My setup is the following. I use a conda environment with python 3.11 as suggested in this thread:

conda create -n create-llama python=3.11
conda activate create-llama
conda install poetry
poetry install
npx create-llama@latest
✔ What is your project named? … my-app
✔ Which template would you like to use? › Agentic RAG (e.g. chat with docs)
✔ Which framework would you like to use? › FastAPI (Python)
✔ Would you like to generate a NextJS frontend for your FastAPI (Python) backend? … No / Yes
✔ Would you like to set up observability? › Traceloop
✔ Please provide your OpenAI API key (leave blank to skip): … 
✔ Which data source would you like to use? › Use website content (requires Chrome)
✔ Please provide base URL of the website:  … https://example.com/
✔ Would you like to add another data source? › No
✔ Would you like to use a vector database? › PostgreSQL
✔ Would you like to build an agent using tools? If so, select the tools here, otherwise just press enter › 
✔ How would you like to proceed? › Generate code and install dependencies (~2 min)
marcusschiesser commented 1 month ago

@lumalik fixed in 0.2.8 - please try again