Getting missing API regardless

pc = Pinecone(api_key=pinecone_api_key)
index_name=‘annvec’
index = pc.Index(index_name)

embeddings = OpenAIEmbeddings(
openai_api_key=openai_api_key
)
from langchain.vectorstores import Pinecone as PineconeStore
docsearch=PineconeStore.from_texts(
[t.page_content for t in textchunk],
embeddings,
index_name=index_name
)
PineconeConfigurationError: You haven’t specified an Api-Key.
I am getting missing API :frowning: for docsearch…any help pls…I have been at this issue …seems like forever!

Hi @anithakse1975, when using the PineconeVectorStore class from LangChain, you need to have your Pinecone API key specified as an environment variable.

In your console, you can run:

export PINECONE_API_KEY=<your Pinecone API key available at app.pinecone.io>

If you are working in a notebook, you can run:

import os

os.environ['PINECONE_API_KEY'] = '<YOUR_PINECONE_API_KEY>'