Find answers from the community

Updated 9 months ago

Llama index

Hey! I've finally decided to migrate my project to v0.10, however I can't find the cause of the following error message. when I try to run: llamaindex-cli upgrade <target folder>
I get this error: "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/llama_index/core/utilities/token_counting.py", line 6, in <module>
from llama_index.core.llms import ChatMessage, MessageRole
ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/llama_index/core/llms/init.py)

I tried creating a new env from scratch (with conda, pyenv and also python venv), however I repeatedly get this error. Is the llamaindex-cli broken, or is there another way to resolve this problem? I couldn't find anything here or in the github repo.
L
D
5 comments
Hmmm, just as a sanity check, in a brand new fresh terminal

Plain Text
pip uninstall llama-index  # remove any global install
python -m venv venv
source venv/bin/activate
pip install llama-index --upgrade --no-cache-dir --force-reinstall
Unfortunately this didn't resolve it. Do you have any other idea?
I tried running it in a docker container, there it actually works, even though I needed to uninstall the old llama-index and install the new version.
My other idea would be to just completely uninstall everything in a current env

Plain Text
pip freeze | xargs pip uninstall -y
pip install llama-index --upgrade --no-cache-dir --force-reinstall
thanks, i will give it a try!
Add a reply
Sign up and join the conversation on Discord