Streamlit error: 'cannot import name 'VectorStoreIndex' from 'llama_index.core

Hi there,

I’m receiving the below error message in my streamlit chatbot. Could you please advise what I need to do here. Thank you!

…

ImportError: cannot import name ‘VectorStoreIndex’ from ‘llama_index.core’
(/home/adminuser/venv/lib/python3.11/site-packages/llama_index/core/init.py)
2026-11-11 19:27:33.718 503 GET /script-health-check (127.0.0.1) 308.68ms
────────────────────── Traceback (most recent call last) ───────────────────────
/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru
nner/exec_code.py:88 in exec_func_with_error_handling

/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru
nner/script_runner.py:579 in code_to_exec

/mount/src/streamlit-appv1/llama_app.py:4 in

  1 import os                                                               
  2 import streamlit as st                                                  
  3 from PIL import Image                                                   

❱ 4 from llama_index.core import (
5 │ VectorStoreIndex,
6 │ SimpleDirectoryReader,
7 │ Settings
────────────────────────────────────────────────────────────────────────────────
ImportError: cannot import name ‘VectorStoreIndex’ from ‘llama_index.core’
(/home/adminuser/venv/lib/python3.11/site-packages/llama_index/core/init.py)
2026-11-11 19:27:38.773 503 GET /script-health-check (127.0.0.1) 309.78ms

This error is due to a major update in llama-index (version 0.10.0 and later) that changed its package structure. Your code is using the new import path (from llama_index.core import ...), but your installed library version appears to be older or in an inconsistent state.

The most reliable way to resolve this is to upgrade llama-index to the latest version in your virtual environment. This will align your installed package with the import statements your code expects.

Run the following command in your terminal:

pip install -U llama-index

If you still face issues, a forced reinstall can help clear up any conflicting sub-dependencies:

pip install --upgrade --force-reinstall llama-index