# Pinecone-client update broke legacy chatbot using pinecone Vectorstores

**URL:** https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257
**Category:** Support
**Created:** [January 23, 2024, 4:48pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257 "2024-01-23T16:48:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![charles.eubanks](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/charles.eubanks/32/727_2.png) [@charles.eubanks](https://community.pinecone.io/u/charles.eubanks)
#### Post date: [January 23, 2024, 4:48pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257/1 "2024-01-23T16:48:14Z")

</div>

Have a legacy chatbot that was working fine… last night installed canopy and deployed a test DB as per James’s intro and worked great. This AM in my old bot now getting the error that pinecone.init( is deprecated:

> AttributeError: init is no longer a top-level attribute of the pinecone package.
> 
> Please create an instance of the Pinecone class instead.

I am not sure whether this is something on the account settings , dependencies or what but need a little help! Note the canopy install was done on a different machine and venv so that’s what makes me think something on the pinecone client account setup is the culprit.

EDIT: confirmed this appears to be an upgraded dependency after testing with an old version of the connector, at this point seems best to just try and update all dependencies and go with the new API call

thanks!

---

<div class="post-metadata">

### Author: ![roy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/roy/32/830_2.png) [@roy](https://community.pinecone.io/u/roy)
#### Post date: [January 23, 2024, 6:00pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257/2 "2024-01-23T18:00:23Z")

</div>

your EDIT is on point

I think that pip did not update the pinecone client version, try to use the the `-U` flag when installing

let us know if that helped!

---

<div class="post-metadata">

### Author: ![charles.eubanks](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/charles.eubanks/32/727_2.png) [@charles.eubanks](https://community.pinecone.io/u/charles.eubanks)
#### Post date: [January 23, 2024, 6:37pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257/3 "2024-01-23T18:37:14Z")

</div>

ok I recall now why; I backed out the upgrade because I could not get past this error…I have -U’d everything including langchain\_community OpenAi and pinecone-client now but stuck here:

pc = Pinecone(api\_key=pinecone\_api\_key)  
TypeError: Pinecone. **init** () got an unexpected keyword argument ‘api\_key’.

When I remove it and call the plain class without an api argument I get:  
Pinecone. **init** () missing 3 required positional arguments: ‘index’, ‘embedding’, and ‘text\_key’ which does not match at all the new specs I find for creating a new Pinecone client… confirmed pinecone version running after upgrade “pip show” is:  
Name: pinecone-client  
Version: 3.0.1  
Summary: Pinecone client and SDK

EDIT:  
Narrowed this to being a conflict between the Pinecone and Langchain imports:  
**from langchain\_community.vectorstores import Pinecone** and appears to be a gap between the pinecone-client update and the langchain dev catching up. Still leaves me stuck however or else in a spot to ditch langchain… hoping someone else has upgraded Pinecone and dealt with this ?

versions are as follows:  
pinecone-client 3.0.1  
langchain-community 0.0.14  
langchain-core 0.1.15

EDIT: Solved here but just FYI for anyone else this requires a work around for langchain - post on reddit got me past **from langchain\_community.vectorstores import Pinecone as pcvs** and that was followed by a retrofitting of both openAi and langchain code changes to match new api calls…tooks me the better part of a day to upgrade all libraries then change openai completion messages to match new completion calls

---

<div class="post-metadata">

### Author: ![regutonlabs](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/regutonlabs/32/1769_2.png) [@regutonlabs](https://community.pinecone.io/u/regutonlabs)
#### Post date: [January 24, 2024, 7:33pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257/4 "2024-01-24T19:33:32Z")

</div>

On the same boat here… I opened up an issue with langchain to address this earlier today.

> <https://github.com/langchain-ai/langchain/issues/16513#issuecomment-1908491424>
>
> \### Checked other resources
> 
> \- \[X\] I added a very descriptive title to this is…sue.
> \- \[X\] I searched the LangChain documentation with the integrated search.
> \- \[X\] I used the GitHub search to find a similar question and didn't find it.
> 
> \### Example Code
> 
> Attempting to initialize PineconeConnected
> 
> \`\`\`
> import pinecone
> from langchain.embeddings.openai import OpenAIEmbeddings
> from langchain.vectorstores import Pinecone
> from langchain.schema import Document
> 
> class PineconeConnected():
> def \_\_init\_\_(self, index\_name: str, pinecone\_api\_key: str, pinecone\_env: str, openai\_key: str):
> embeddings = OpenAIEmbeddings(openai\_api\_key=openai\_key)
> pinecone.init(api\_key=pinecone\_api\_key)
> self.vector\_db = Pinecone.from\_existing\_index(index\_name, embeddings) # VectorStore object with the reference + Pinecone index loaded
> 
> def query(query:str, book\_title=None)
> \`\`\`
> 
> \### Description
> 
> when initializing PineconeConnected class, I get this error:
> \*Please note that this was previously working. pinecone-client updated its library a few days ago hence why this integration with 'init' no longer works.
> 
> 
> \`\`\`
> AttributeError: init is no longer a top-level attribute of the pinecone package.
> 
> Please create an instance of the Pinecone class instead.
> 
> Example:
> 
> import os
> from pinecone import Pinecone, ServerlessSpec
> 
> pc = Pinecone(
> api\_key=os.environ.get("PINECONE\_API\_KEY")
> )
> 
> # Now do stuff
> if 'my\_index' not in pc.list\_indexes().names():
> pc.create\_index(
> name='my\_index', 
> dimension=1536, 
> metric='euclidean',
> spec=ServerlessSpec(
> cloud='aws',
> region='us-west-2'
> )
> )
> 
> \`\`\`
> \### System Info
> 
> fastapi-poe==0.0.24
> pydantic\>=2
> openai==0.28.1
> langchain==0.0.348
> pinecone-client==3.0.1
> tiktoken
> 
> \### Related Components
> 
> \- \[\] LLMs/Chat Models
> \- \[\] Embedding Models
> \- \[\] Prompts / Prompt Templates / Prompt Selectors
> \- \[\] Output Parsers
> \- \[\] Document Loaders
> \- \[\] Vector Stores / Retrievers
> \- \[\] Memory
> \- \[\] Agents / Agent Executors
> \- \[\] Tools / Toolkits
> \- \[\] Chains
> \- \[\] Callbacks/Tracing
> \- \[\] Async

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/1X/d16664eba369eeee623700cf12feab5562b37eaf.jpeg) [@system](https://community.pinecone.io/u/system)
#### Post date: [February 6, 2024, 4:19pm UTC](https://community.pinecone.io/t/pinecone-client-update-broke-legacy-chatbot-using-pinecone-vectorstores/4257/5 "2024-02-06T16:19:56Z")

</div>

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