Object 'Pinecone' has no attribute 'from_texts'

I was previously running the following in production:

import pinecone
pinecone.init(
    api_key='xxxx',
    environment="xxxx"
)
index_name = "langchainpinecone"

The change in .init method means I had to change to:

from pinecone import Pinecone

pc = Pinecone(api_key='9266f963-32f8-453b-8571-38424c090c2d')

However, now my critical from_texts method does not work:

docsearch=Pinecone.from_texts([t.page_content for t in docs], embeddings, index_name=index_name)

AttributeError Traceback (most recent call last)

in <cell line: 1>() ----> 1 docsearch=Pinecone.from_texts([t.page_content for t in docs], embeddings, index_name=index_name)

AttributeError: type object ‘Pinecone’ has no attribute ‘from_texts’

How can I recover?

Yeah, I have this exact same issue and also tried the Pinecone.from_documents() function and same issue where there is no attribute “from_documents…”

It’ll be great to see what happened to the from_texts function as many tutorials online have this line of code to take text and insert it into a Pinecone DB instance.

Here is the fix found after hours googling:

If only Pinecone, a vector store for language embeddings, had a way to semantically search their own community forums full of language… hmm…

2 Likes

Good point @jamin.thalaivaa! We have a support chatbot powered by Pinecone, which gives a similar answer to what you found: https://support.pinecone.io/
We’ll make it easier to find from the forum.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.