Closed ljhust closed 1 year ago
As a workaround, this seems to work:
from langchain.vectorstores.chroma import Chroma
Not sure why __init__
is not exposing Chroma
, as it appears to be imported correctly.
It is my version: lanchain==0.0.84 and source below there is no Chroma included
should be fixed now
App 2066 output: from langchain.vectorstores import Chroma App 2066 output: ImportError: App 2066 output: cannot import name 'Chroma' from 'langchain.vectorstores' (/home/aidesign/virtualenv/groundskeeper/3.7/lib/python3.7/site-packages/langchain/vectorstores/init.py)
This error seems to still be present for me
App 2066 output: from langchain.vectorstores import Chroma App 2066 output: ImportError: App 2066 output: cannot import name 'Chroma' from 'langchain.vectorstores' (/home/aidesign/virtualenv/groundskeeper/3.7/lib/python3.7/site-packages/langchain/vectorstores/init.py)
This error seems to still be present for me
did you try to bump langchain in your requirements.txt, or take version constraint away and then: pip install langchain --upgrade
Installing collected packages: langchain
Attempting uninstall: langchain
Found existing installation: langchain 0.0.58
Uninstalling langchain-0.0.58:
Successfully uninstalled langchain-0.0.58
Successfully installed langchain-0.0.146
update langchain version
can someone help me
i get this error
Traceback (most recent call last): File "c:\Users\IvanRivaldo\anaconda3\envs\pytorch\Lib\site-packages\langchain\vectorstores\chroma.py", line 80, in init import chromadb File "c:\Users\IvanRivaldo\anaconda3\envs\pytorch\Lib\site-packages\chromadb__init.py", line 4, in
import chromadb.config File "c:\Users\IvanRivaldo\anaconda3\envs\pytorch\Lib\site-packages\chromadb\config.py", line 12, in init.py", line 210, in getattr__ File "c:\Users\IvanRivaldo\anaconda3\envs\pytorch\Lib\site-packages\pydantic_migration.py", line 289, in wrapper pydantic.errors.PydanticImportError:from pydantic import BaseSettings, validator File "c:\Users\IvanRivaldo\anaconda3\envs\pytorch\Lib\site-packages\pydantic\ BaseSettings
has been moved to thepydantic-settings
package. See https://docs.pydantic.dev/2.3/migration/#basesettings-has-moved-to-pydantic-settings for more details.For further information visit https://errors.pydantic.dev/2.3/u/import-error
this is my code:
fromlangchain.vectorstores import Chroma
....
vectorstore = Chroma.from_texts(texts, embeddings)
...
After a long workaround i solved the issue like this. override chromadb with pysqlite3-binary Please note that this is applicable for linux only . In window i used python 3.11.5 to solve the issue.
install pysqlite3-binary pip install pysqlite3-binary
Add this in your project code where importing chroma
from langchain.vectorstores.chroma import Chroma sys.modules['sqlite3'] = import('pysqlite3')
what about mac ? also i get error 24-06-13 10:14:35.016 Uncaught app exception
Traceback (most recent call last):
File "/Users/shobhitupadhyay/anaconda3/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "/Users/shobhitupadhyay/Stream/main.py", line 9, in
following doc below: https://langchain.readthedocs.io/en/latest/modules/utils/combine_docs_examples/vectorstores.html from langchain.vectorstores import ElasticVectorSearch, Pinecone, Weaviate, FAISS, Qdrant, Chroma could not find Chroma, as ref to the source code Chroma module has been delayed, please modify the doc correctly