Find answers from the community

Updated 3 months ago

Error

I am trying to use PineconeVectorStore to save and query index but getting below error. It looks something from library (pinecone.py ) . Already upgraded llama_index and langchain to latest version.

Code :

#initialize pinecone client pinecone.init(api_key=api_key, environment="us-west1-gcp-free") pinecone_index = pinecone.Index("pi-starter-index") #load document documents = SimpleDirectoryReader('input/text').load_data() # create vector store vector_store = PineconeVectorStore( pinecone_index=pinecone_index ) storage_context = StorageContext.from_defaults(vector_store=vector_store) index = VectorStoreIndex.from_documents(documents, storage_context=storage_context) query_engine = index.as_query_engine() response = query_engine.query("What did the author do growing up?") print(response)

Error:

Traceback (most recent call last): File "c:\MyStuffs\Code\llama_index\vector db\basic_pinecone_db.py", line 30, in <module> vector_store = PineconeVectorStore( File "C:\Python39\lib\site-packages\llama_index\vector_stores\pinecone.py", line 169, in __init__ tokenizer = get_default_tokenizer() File "C:\Python39\lib\site-packages\llama_index\vector_stores\pinecone.py", line 82, in get_default_tokenizer ** from transformers import BertTokenizerFast ModuleNotFoundError: No module named 'transformers' **
L
p
3 comments
As the error states, you need to install transformers

pip install transformers

This is an optional dependency, which is only hit when using python3.8
oh ok.. I thought everything related to pinecone will get installed automatically when i install pinecone using : pip install pip install pinecone-client
yea, this is actually a llama-index specific thing, unrelated to pinecone πŸ™‚
Add a reply
Sign up and join the conversation on Discord