llama_index: ModuleNotFoundError: No module named 'llama_index.query_engine'

Using 0.6.13 from llama_index.query_engine import RetrieverQueryEngine

getting ModuleNotFoundError: No module named ‘llama_index.query_engine’

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21

Most upvoted comments

ok, I found the issue. thanks for you help

ok, I found the issue. thanks for you help

Bro finding and not telling ha it is disrespectfull 😦

The llama-index package format has changed, try importing this way and it should work:

from llama_index.core.query_engine import ...

They are now part of llama_index.core. This should work.

from llama_index.core.retrievers import VectorIndexRetriever from llama_index.core.query_engine import RetrieverQueryEngine from llama_index.core.indices.postprocessor import SimilarityPostprocessor

Hi there, in my case I was running the code in an outdated version of Jupyter, running the following commands fix it form me:

pip3 install --upgrade jupyter-console
pip3 install --upgrade jupyter

@alonhartal do you have a python file called llama_index.py? If so, rename that to something else

The problem is fixed by running this command in terminal:

pip install llama-index-experimental

then inserting this in the main.py file:

from llama_index.experimental.query_engine.pandas import PandasQueryEngine

Then this code will run flowlessly:

population_query_engine = PandasQueryEngine(df=population_df, verbose=True)

Solution link: https://docs.llamaindex.ai/en/stable/api_reference/query_engine/pandas/?h=pandasqueryengine#llama_index.experimental.query_engine.PandasQueryEngine

@RisabBiswas it worked for me thanks bro

Thanks Labern31! Worked for me.

Yes, indeed! Thanks for the help @Labern31

I am still getting the same issue. I am not using jupyter. I solved this by rolling back to llama-index==0.9.48

Edit: Nevermind now I have a different import error:

ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms'