run-llama/llama_index · critical · ImportError
`llama-index-embeddings-clip` package not found, please run
Error message
`llama-index-embeddings-clip` package not found, please run `pip install llama-index-embeddings-clip` and `pip install git+https://github.com/openai/CLIP.git`
What it means
Passing an embed_model string starting with 'clip' (e.g. 'clip:ViT-B/32') makes resolve_embed_model build a ClipEmbedding for multi-modal image embedding. That class lives in the optional llama-index-embeddings-clip integration plus OpenAI's CLIP repo, neither bundled with core — an ImportError is raised telling you exactly what to install.
Source
Thrown at llama-index-core/llama_index/core/embeddings/utils.py:87
"Original error:\n"
f"{e!s}"
"\nConsider using embed_model='local'.\n"
"Visit our documentation for more embedding options: "
"https://developers.llamaindex.ai/python/framework/module_guides/"
"models/embeddings/"
"\n******"
)
# for image multi-modal embeddings
elif isinstance(embed_model, str) and embed_model.startswith("clip"):
try:
from llama_index.embeddings.clip import ClipEmbedding # pants: no-infer-dep
clip_model_name = (
embed_model.split(":")[1] if ":" in embed_model else "ViT-B/32"
)
embed_model = ClipEmbedding(model_name=clip_model_name)
except ImportError as e:
raise ImportError(
"`llama-index-embeddings-clip` package not found, "
"please run `pip install llama-index-embeddings-clip` and `pip install git+https://github.com/openai/CLIP.git`"
)
if isinstance(embed_model, str):
try:
from llama_index.embeddings.huggingface import (
HuggingFaceEmbedding,
) # pants: no-infer-dep
splits = embed_model.split(":", 1)
is_local = splits[0]
model_name = splits[1] if len(splits) > 1 else None
if is_local != "local":
raise ValueError(
"embed_model must start with str 'local' or of type BaseEmbedding"
)
View on GitHub (pinned to afd0fef371)
Solutions
- pip install llama-index-embeddings-clip && pip install git+https://github.com/openai/CLIP.git
- Alternatively switch to another multimodal embedding you already have installed and pass it as an instance
- Pin CLIP install in requirements.txt so CI reproduces it
Example fix
// before Settings.embed_model = "clip:ViT-B/32" # ImportError // after # pip install llama-index-embeddings-clip # pip install git+https://github.com/openai/CLIP.git Settings.embed_model = "clip:ViT-B/32"
Defensive patterns
Strategy: fallback
Validate before calling
try:
import llama_index.embeddings.clip # noqa: F401
has_clip = True
except ImportError:
has_clip = False
embed_model = "clip:ViT-B/32" if has_clip else "local:BAAI/bge-small-en-v1.5" Try / catch
try:
Settings.embed_model = "clip:ViT-B/32"
except ImportError as e:
if "llama-index-embeddings-clip" in str(e):
raise RuntimeError("pip install llama-index-embeddings-clip and CLIP, or choose another model") from e
raise Prevention
- Install and pin both llama-index-embeddings-clip and the CLIP git dep in requirements
- Feature-detect the import before selecting 'clip:...' in multi-modal pipelines
- Document that CLIP requires a GPU-friendly environment (torch, ftfy, regex)
When it happens
Trigger: Settings.embed_model = 'clip' or 'clip:ViT-L/14' (or LlamaParse multimodal defaults using CLIP) without llama-index-embeddings-clip installed; fresh environment cloned from a project that relied on CLIP.
Common situations: Following multi-modal retrieval examples on a slim install; CI missing the extra; the CLIP git dependency failing to install on some platforms.
Related errors
- `llama-index-embeddings-openai` package not found, please ru
- `llama-index-embeddings-huggingface` package not found, plea
- `llama-index-embeddings-langchain` package not found, please
- Invalid Embedding name: {name}
- Unhandled shape {array.shape}.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/9011b5988206b667.
Report an issue: GitHub.