Chromadb Vector database

vectordb = Chroma.from_documents(
documents=splits,
embedding=embedding,
persist_directory=persist_directory
)

ImportError: Could not import chromadb python package. Please install it with pip install chromadb.

getting this Import error, tried multiple versions of chromadb nothing worked for me.

Please use !pip list | grep -i chromadb to grab the version of the library inside the deeplearning.ai notbook.

Actually I was running in local

I’m having the same issue when running local. I also tried installing chromadb several times. The error returns like this:


ModuleNotFoundError Traceback (most recent call last)
File c:\Users(…)\venv\lib\site-packages\langchain_community\vectorstores\chroma.py:81, in Chroma.init(self, collection_name, embedding_function, persist_directory, client_settings, collection_metadata, client, relevance_score_fn)
80 try:
—> 81 import chromadb
82 import chromadb.config

ModuleNotFoundError: No module named ‘chromadb’

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
Cell In[16], line 1
----> 1 vectordb = Chroma.from_documents(
2 documents=splits,
3 embedding=embedding,
4 persist_directory=persist_directory
5 )

File c:\Users(…)\venv\lib\site-packages\langchain_community\vectorstores\chroma.py:778, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
776 texts = [doc.page_content for doc in documents]
777 metadatas = [doc.metadata for doc in documents]
→ 778 return cls.from_texts(
779 texts=texts,
780 embedding=embedding,

87 )
89 if client is not None:
90 self._client_settings = client_settings

ImportError: Could not import chromadb python package. Please install it with pip install chromadb.

1 Like
pip install chromadb==0.3.26

Reference notebook: https://learn.deeplearning.ai/langchain-chat-with-your-data/lesson/4/vectorstores-and-embedding

I am facing the same error. Also, when I am trying to uninstall the chromadb to install it again failing to do so.

I ran into a different error when installing chroma locally, but sharing the solution here in case it helps. The error was:

error: command '/usr/bin/clang' failed with exit code 1
ERROR: Could not build wheels for chroma-hnswlib, which is required to install pyproject.toml-based projects

I was able to install Chroma by running:

export HNSWLIB_NO_NATIVE=1 
pip install chromadb

Once you install it, you can unset the env variable if you want.

My error is related to the output provided, I’ve followed the code exactly from the course, i didn’t receive any message to install chromadb, but the answer to this question:
question = “is there an email i can ask for help”
output: “over the last 15, 20 years in an electronic format. \nTurns out that most of you probably use learning algorithms — I don’t know — I think \nhalf a dozen times a day or maybe a dozen times a day or more, and often without \nknowing it. So, for example, every time you se nd mail via the US Postal System, turns \nout there’s an algorithm that tries to automa tically read the zip code you wrote on your \nenvelope, and that’s done by a learning al gorithm. So every time you send US mail, you \nare using a learning algorithm, perhap s without even being aware of it.”

as you can see, has nothing related to the question…

How do I resolve this?

I’m using jupyter notebook in vsc, and have a message:
→ ‘rm’ is not recognized as an internal or external command,
operable program or batch file.
When trying to use remove the file, I’ve tried other methods, but just resulted in and error

Is this the reason why the output to the question is not working correctly?

I’m encountering this quiet often when using Chroma and langchain in other projects, where the output from the vector has nothing related to the query…what can i do?

Adding @Deepti_Prasad to point you to material related to hallucination and temperature.

1 Like

I’ve resolved the ‘rm’ is not recognized issue.

thanks looking forward to it :slight_smile:

Thanks @balaji.ambresh.

hi @meomeo can I know what is your doubt related to temperature and hallucination?

Going through your query it looked more of environment to module access issue.

I think this is 3 or 4th time I am seeing a learner having issue with vsc. (How did you resolve your issue)

Your output not being specific to your question? can be related temperature but actually I haven’t seen the codes of this course, so can you share screenshot of the codes here.

Regards
DP

hey how to resolve this issue.. even i am also getting same error.. i am doing all the google colab..please suggest