Unable to install Python package llama-index-embeddings-huggingface

I am trying to implement the code discussed in the HuggingFace cookbook article at Building A RAG Ebook “Librarian” Using LlamaIndex - Hugging Face Open-Source AI Cookbook.

I am on an iMac Pro running Sequoia 15.1.1 and Python 3.13.0. Unfortunately the article does not provide package versions.

I get to the point where I am trying to install the package in question:

llama-index-embeddings-huggingface

I get the following error:

ERROR: Cannot install llama-index-embeddings-huggingface==0.1.3, llama-index-embeddings-huggingface==0.1.4 and llama-index-embeddings-huggingface==0.1.5 because these package versions have conflicting dependencies.

The conflict is caused by:

llama-index-embeddings-huggingface 0.1.5 depends on torch<3.0.0 and >=2.1.2
llama-index-embeddings-huggingface 0.1.4 depends on torch<3.0.0 and >=2.1.2
llama-index-embeddings-huggingface 0.1.3 depends on torch<3.0.0 and >=2.1.2

I assume that torch is PyTorch, which is not currently installed.

I am using the command:

python3 -m pip install llama-index-embeddings-huggingface

which causes the mentioned error.

I am not sure what to try to resolve the conflict.

1 Like

Hey,

I haven’t faced the same problem, so maybe my suggestion won’t be that useful, but I think it’ll fix the issue.

First, instead of using pip as package manager, install uv. Then, create an environment, uv venv, follow the instructions, then uv pip “packages”. Uv is very efficient in solving compatibility problems.

If it doesn’t work, I’d suggest downloading the package directly from github and manually installing with uv pip install .

1 Like

Also, your python is too recent, probably that’s the problem. With uv you can get a specific version for the environment.

1 Like