0
from llama_index import SimpleDirectoryReader, ServiceContext, VectorStoreIndex
from llama_index.llms import OpenAI

Upon trying the above imports I get the following error:

ImportError: cannot import name 'SimpleDirectoryReader' from 'llama_index' (unknown location)

Along with:

ModuleNotFoundError: No module named 'llama_index.llms'

I have tried importing llama index via both pip and directly from github.

I am using 0.7.18 version of llama-index.

abstract
  • 21
  • 5

1 Answers1

0

I found the solution to my problem. It occurred as I both imported Jerry's github repo and installed via pip. After renaming the local package as follows, problem solved.

mv llama_index llama_index_jerry
cd llama_index_jerry
pip install -e

Solution was inspired by this answer:ImportError: cannot import name 'app' from 'mypackage' (unknown location)

abstract
  • 21
  • 5