{"record":{"id":"955720201afaa04f","repo":"run-llama/llama_index","slug":"llama-index-embeddings-openai-package-not-found","errorCode":null,"errorMessage":"`llama-index-embeddings-openai` package not found, please run `pip install llama-index-embeddings-openai`","messagePattern":"`llama-index-embeddings-openai` package not found, please run `pip install llama-index-embeddings-openai`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"llama-index-core/llama_index/core/embeddings/utils.py","lineNumber":60,"sourceCode":"    if embed_model == \"default\":\n        if os.getenv(\"IS_TESTING\"):\n            embed_model = MockEmbedding(embed_dim=8)\n            embed_model.callback_manager = callback_manager or Settings.callback_manager\n            return embed_model\n\n        try:\n            from llama_index.embeddings.openai import (\n                OpenAIEmbedding,\n            )  # pants: no-infer-dep\n\n            from llama_index.embeddings.openai.utils import (\n                validate_openai_api_key,\n            )  # pants: no-infer-dep\n\n            embed_model = OpenAIEmbedding()\n            validate_openai_api_key(embed_model.api_key)  # type: ignore\n        except ImportError:\n            raise ImportError(\n                \"`llama-index-embeddings-openai` package not found, \"\n                \"please run `pip install llama-index-embeddings-openai`\"\n            )\n        except ValueError as e:\n            raise ValueError(\n                \"\\n******\\n\"\n                \"Could not load OpenAI embedding model. \"\n                \"If you intended to use OpenAI, please check your OPENAI_API_KEY.\\n\"\n                \"Original error:\\n\"\n                f\"{e!s}\"\n                \"\\nConsider using embed_model='local'.\\n\"\n                \"Visit our documentation for more embedding options: \"\n                \"https://developers.llamaindex.ai/python/framework/module_guides/\"\n                \"models/embeddings/\"\n                \"\\n******\"\n            )\n    # for image multi-modal embeddings\n    elif isinstance(embed_model, str) and embed_model.startswith(\"clip\"):","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/embeddings/utils.py#L42-L78","documentation":"resolve_embed_model() falls back to OpenAIEmbedding when embed_model is None or the string 'default'. That requires the optional integration llama-index-embeddings-openai; since llama-index v0.10 the OpenAI integration is no longer a core dependency, so a bare install raises this ImportError telling you to install it.","triggerScenarios":"Constructing any index/retriever (VectorStoreIndex.from_documents(...)) without an embed_model argument on an environment where llama-index-embeddings-openai is not installed; a fresh pip install llama-index-core only.","commonSituations":"Installing the modular llama-index post-0.10 without integration extras; CI or Docker images slimmed to core only; upgrading from llama_index<=0.9 (bundled OpenAI) to the split packages.","solutions":["pip install llama-index-embeddings-openai (or the meta-package pip install llama-index)","Or run fully offline: pass embed_model='local:BAAI/bge-small-en-v1.5' with llama-index-embeddings-huggingface installed","Or pass any explicit BaseEmbedding instance (e.g. HuggingFaceEmbedding) so the OpenAI default is never reached"],"exampleFix":"// before\nindex = VectorStoreIndex.from_documents(docs)  # ImportError: package not found\n\n// after\n# pip install llama-index-embeddings-openai\nindex = VectorStoreIndex.from_documents(docs)\n# or offline:\n# pip install llama-index-embeddings-huggingface\nindex = VectorStoreIndex.from_documents(docs, embed_model=\"local:BAAI/bge-small-en-v1.5\")","handlingStrategy":"fallback","validationCode":"try:\n    import llama_index.embeddings.openai  # noqa: F401\n    has_openai = True\nexcept ImportError:\n    has_openai = False\nif not has_openai and embed_model is None:\n    embed_model = \"local:BAAI/bge-small-en-v1.5\"  # explicit, no default surprise","typeGuard":null,"tryCatchPattern":"try:\n    index = VectorStoreIndex.from_documents(docs)\nexcept ImportError as e:\n    if \"llama-index-embeddings-openai\" in str(e):\n        raise RuntimeError(\"pip install llama-index-embeddings-openai or set embed_model\") from e\n    raise","preventionTips":["Always pass an explicit embed_model instead of relying on the OpenAI default","Pin integration extras in requirements: llama-index-embeddings-openai==<ver>","Fail fast at startup by importing the embedding integration in your bootstrap code"],"tags":["embeddings","dependencies","installation","openai","version-change"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}