With the introduction of LlamaIndex v0.10.0, there were several changes

Thankfully, we've tried to make these changes as easy as possible!

Pre-Requisites

When migrating over to v0.10, please ensure that you are using a fresh virtual environment. Since v0.10 makes use of Python namespace packages, and v0.9.xx or earlier does not, any remnants of legacy llama-index will surely break import paths and cause errors.

# pyenv
pyenv virtualenv venv
pyenv activate venv
pip install llama-index

# venv
python -m venv venv
source venv/bin/activate
pip install llama-index

# conda
conda create -n llama python=3.11 anaconda # can use any Python 3.9 - 3.12 
conda activate llama
pip install llama-index

Automatic Upgrades

To help assist with migrating, pip install llama-index and pip install llama-index-core both come with a command-line tool to update existing code and notebooks.

NOTE: The CLI tool updates files in place. Please ensure you have your data backed up to undo any changes as needed.

After installing v0.10.0, you can upgrade your existing imports automatically:

llamaindex-cli upgrade <source-dir>
llamaindex-cli upgrade-file <path-to-file>

The upgrade-file upgrades a single .py or .ipynb file at a time.

For notebooks, new pip install statements are inserting and imports are updated.

For .py and .md files, import statements are also updated, and new requirements are printed to the terminal.

Manual Upgrades

In this section, we provide a summary table for migrating your codebase from llama-index v0.9.xx to v0.10.0. This table can be used as reference to manually perform the migration or to handle any edge cases that the automatic upgrade too fails to capture.

Migration Summary Table