Skip to content
← Back to activity

Immutable solution version

[Bug] Pinecone has no attribute 'from_texts'

Version 1

Complete solution

How to fix '[Bug] Pinecone has no attribute 'from_texts'' in Pinecone, straight from the verified resolution in gh:pinecone-io/python-sdk#388. Root cause plus what to change.

What was reported

Issue pinecone-io/python-sdk#388 (closed, 5 comments): ---

  • [x] I believe this is a new bug
  • [x] I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug

Describe the bug When attempting to create an embedding using Pinecone in a Google Colab notebook, an AttributeError is raised. The functionality that was working previously to generate embeddings from text chunks is now broken.

Error information The full stack trace of the error is as follows:

AttributeError                            Traceback (most recent call last)
[ipython-input-18-dbd3c6635021] in <cell

## The verified resolution

[mcpaddy (commenter)]: `from_texts` is not a pinecone SDK function at all  -  it belongs to LangChain (`langchain_pinecone.PineconeVectorStore.from_texts()`). The AttributeError comes from calling it on the pinecone client object. There was also a known namespace collision with older LangChain versions, so upgrade langchain and use the LangChain class with an embeddings model (e.g. OpenAIEmbeddings) as shown in the Pinecone LangChain integration guide.

Evidence

Asked in gh:pinecone-io/python-sdk#388 (https://github.com/pinecone-io/python-sdk/issues/388): [Bug] Pinecone has no attribute 'from_texts'. The issue report: Issue pinecone-io/python-sdk#388 (closed, 5 comments): ---

  • [x] I believe this is a new bug
  • [x] I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug

Describe the bug When attempting to create an embedding using Pinecone in a Google Colab notebook, an AttributeError is raised. The functionality that was working previously to generate embeddings from text chunks is now broken.

Error information The full stack trace of the error is as follows:

AttributeError                            Traceback (most recent call last)
[ipython-input-18-dbd3c6635021] in <cell The verified answer: [mcpaddy (commenter)]: `from_texts` is not a pinecone SDK function at all  -  it belongs to LangChain (`langchain_pinecone.PineconeVectorStore.from_texts()`). The AttributeError comes from calling it on the pinecone client object. There was also a known namespace collision with older LangChain versions, so upgrade langchain and use the LangChain class with an embeddings model (e.g. OpenAIEmbeddings) as shown in the Pinecone LangChain integration guide.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_HbstzVoU7k2ORm7VrnWvCw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[Bug] Pinecone has no attribute &#39;from_texts&#39; <span>— Vectle</span></a>

[Bug] Pinecone has no attribute 'from_texts' | Vectle