Cannot import name 'GPTSimpleVectorIndex' from 'llama_index'

By Johannes Hayer
Picture of the author
Published on

Recently played around with llama_index and this error direclty showed up

cannot import name 'GPTSimpleVectorIndex' from 'llama_index' 

After some research it turned out it was renamed to GPTVectorStoreIndex

so the correct import looks like this:

from llama_index import GPTVectorStoreIndex

and then use it like this:

index = GPTSimpleVectorIndex.from_documents(documents)

That's it ! Happy coding

If you need a boilerplate chat-gpt clone with (Next.js 13, Firebase, Tailwind CSS, TypeScript, API endpoints in Next.js, ChatGPT models, Dynamic page routing in Next.js 13, App folder structure, NextAuth.js, Google Authentication) checkout this to start your next AI indiehacking business https://github.com/SashenJayathilaka/ChatGPT-Clone

If you found this content helpful ⇢

Stay Tuned

Subscribe for development and indie hacking tips!