langchain
langchain copied to clipboard
Dependency issue with VectorstoreIndexCreator().from_loaders
When running the following code, I get the message that I need to install the chromadb package. I try to install chromadb, and get the following error with hnswlib.
I've tried creating a brand new venv with just openai, and langchain. Still get this issue. Any idea why this could be, and how to fix it?
I'm using Python 3.11.3 My code:
import os
from langchain.document_loaders import WebBaseLoader
from langchain.indexes import VectorstoreIndexCreator
os.environ["OPENAI_API_KEY"] = ***
loader = WebBaseLoader("https://www.espn.com/soccer")
index = VectorstoreIndexCreator().from_loaders([loader])
The error:
Building wheels for collected packages: hnswlib
Building wheel for hnswlib (pyproject.toml) ... error
error: subprocess-exited-with-error
...
clang: error: the clang compiler does not support '-march=native'
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects
I've tried:
pip install --upgrade pip
pip install --no-cache-dir --no-binary :all: hnswlib
pip install hnswlib chromadb
Thanks!
What environment are you installing it in? I have got the similar issue in docker python:3.10-slim-buster base image and adding apt-get install --no-install-recommends -y build-essential gcc fixed it, however locally with poetry I didn't have the issue.
The issue was due to using python 3.11, downgrading to 3.9 resolved this.
The issue was due to using Python 3.11, downgrading to 3.9 resolved this.
I am using Python 3.9 and facing the same issue; any suggestions, please?