LlamaIndex keeps its indexing framework and provider integrations in separate Python packages. A missing integration module error usually means that the application has llama-index-core but lacks the package for a requested embedding model, language model, or reader, and installing that package or setting the intended model lets the failing import or index creation succeed. The right repair depends on whether that integration was selected deliberately or loaded as a default.

Installing an integration in another virtual environment does not make it available to the running application. Using the application's Python interpreter for both package inspection and installation avoids a misleading situation where pip reports an installed package while the application still cannot import it.

An OpenAI package error can also appear without an OpenAI import in the application. Index creation can request the default embedding model, while query-engine creation can request the default language model. An application intended to use other providers needs explicit model settings before those objects are created.

Steps to fix missing integration module errors in LlamaIndex:

  1. Identify the missing module in the original traceback.
    $ python -c "from llama_index.embeddings.openai import OpenAIEmbedding"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'llama_index.embeddings'

    A core-only installation can report the parent namespace, such as llama_index.embeddings or llama_index.llms. During index creation, the final exception can instead name the distribution directly, such as ImportError: `llama-index-embeddings-openai` package not found, please run `pip install llama-index-embeddings-openai`. The application frame above that error distinguishes an explicit provider import from an automatically selected default.

  2. Check the Python executable used by the failing application.
    $ python -c "import sys; print(sys.executable)"
    /opt/venv/bin/python

    The path varies by environment. Here, python means the interpreter that launches the application. If the application runs through an IDE or notebook, its configured interpreter or kernel must match the executable used for installation.

  3. Inspect the core and OpenAI integration packages in that environment.
    $ python -m pip show llama-index-core llama-index-embeddings-openai llama-index-llms-openai
    WARNING: Package(s) not found: llama-index-embeddings-openai, llama-index-llms-openai
    Name: llama-index-core
    Version: 0.14.25
    ##### snipped #####
    Location: /opt/venv/lib/python3.12/site-packages
    ##### snipped #####

    A Package(s) not found warning for an integration identifies an absent distribution. The Location field of an installed package shows where that interpreter finds it. A package being installed in a different interpreter does not resolve the import failure.

  4. Match the failing import to its documented integration package.
    Import:  llama_index.embeddings.openai
    Package: llama-index-embeddings-openai
    
    Import:  llama_index.llms.openai
    Package: llama-index-llms-openai

    Other integrations have their own distribution names. An ImportError: cannot import name … from a module that exists can indicate an outdated symbol or import path rather than an absent package. Blindly installing more integrations does not resolve that case.
    Related: LlamaIndex integrations

  5. Install the package for the provider that the application intends to use.

    In an older environment, this install can upgrade llama-index-core and leave other installed integrations with dependency conflicts.

    $ python -m pip install llama-index-embeddings-openai

    For from llama_index.llms.openai import OpenAI, use python -m pip install llama-index-llms-openai instead. If OpenAI was an unintended default, install the packages for your chosen models instead of the OpenAI package. This local pair uses Hugging Face embeddings and Ollama.

    $ python -m pip install \
      llama-index-embeddings-huggingface \
      llama-index-llms-ollama

    The Hugging Face package brings in sentence-transformers and PyTorch, which left a virtual environment of about 6 GB on Linux arm64. The complete llama-index package is no shortcut, because it requires both OpenAI integrations and holds them below their current releases. Tested with Python 3.12 and llama-index-core 0.14.25 on Linux.

  6. Retest the failing import with your own module and class if the application imports the integration directly.
    $ python -c "from llama_index.embeddings.openai import OpenAIEmbedding; print(OpenAIEmbedding.__module__)"
    llama_index.embeddings.openai.base

    Importing the class makes no API call. For a language-model import failure, the equivalent check returns the module shown here.

    $ python -c "from llama_index.llms.openai import OpenAI; print(OpenAI.__module__)"
    llama_index.llms.openai.base
  7. Use your text editor to open the file that creates the index, app.py here, if OpenAI was selected unintentionally.
  8. Insert the following lines after the imports in app.py and before the first index is created, replacing both models with the ones your application should use.
    app.py
    from llama_index.core import Settings
    from llama_index.embeddings.huggingface import (
        HuggingFaceEmbedding,
    )
    from llama_index.llms.ollama import Ollama
     
    Settings.embed_model = HuggingFaceEmbedding(
        model_name="sentence-transformers/all-MiniLM-L6-v2",
    )
    Settings.llm = Ollama(
        model="qwen2.5:1.5b",
        context_window=4096,
        request_timeout=120.0,
    )

    The assignments must run before the index exists, because placing them after it brings back the same ImportError. The embedding model and language model are separate settings. An application that never creates a query engine needs only the Settings.embed_model assignment and its import, while configuring only Settings.llm leaves the embedding default in place. This local pair downloads the embedding model on first use, and the Ollama model must already be pulled on a running server, with context_window limiting its memory use. This branch applies to automatic defaults, not to an explicit OpenAI import that the application still needs. Disabling embeddings or replacing them with a mock changes retrieval behavior and is unsuitable as a general repair for a working search application.
    Related: How to set an embedding model in LlamaIndex
    Related: How to use Sentence Transformers embeddings in LlamaIndex
    Related: How to connect LlamaIndex to Ollama

  9. Save app.py if its model configuration changed.
  10. Rerun the application operation that originally failed, which sends data to any hosted provider it uses and may incur usage charges. Example output:
    $ python app.py
    ##### snipped #####
    Password resets are handled through the identity portal.

    This reply comes from the local pair above, running the app.py shown here. Wording varies between runs, and the omitted Hugging Face token warning and weight-loading progress are harmless. Your own application returns its normal result instead. Success means the same interpreter now completes the original import, indexing, or query operation without the missing-module exception. A later authentication or model-service error indicates that execution reached a different problem, such as No API key found for OpenAI after installing an OpenAI integration without a key. Installing the integration alone does not configure a provider account or start a model service.
    Related: How to configure an OpenAI LLM in LlamaIndex

    app.py
    from llama_index.core import Document, VectorStoreIndex
    from llama_index.core import Settings
    from llama_index.embeddings.huggingface import (
        HuggingFaceEmbedding,
    )
    from llama_index.llms.ollama import Ollama
     
    Settings.embed_model = HuggingFaceEmbedding(
        model_name="sentence-transformers/all-MiniLM-L6-v2",
    )
    Settings.llm = Ollama(
        model="qwen2.5:1.5b",
        context_window=4096,
        request_timeout=120.0,
    )
     
    documents = [
        Document(text="Password resets use the identity portal."),
    ]
    index = VectorStoreIndex.from_documents(documents)
    query_engine = index.as_query_engine()
    print(query_engine.query("Where are password resets handled?"))
Share this guide