Open VEDANTBISHT opened 4 months ago
Is it working now?
@VEDANTBISHT I was facing the same issue. After debugging for much time, got to know that pinecone-client version <=2.2.4 only supports init package and is deprecated in furthur releases. [Ref. : Pinecone-Migration-Guide]
pip uninstall pinecone-client
pip install pinecone-client==2.2.4
I reduced to a lower version but after that there was no more environment variable on the pinecone website and when I tried using chromadb it didn't work, especially with the hugging face embeddings I have been trying to solve this but to no avail. Does anyone have a fix
I encountered the same issue, this can be tackled as follows.
Since __init__
is no longer a top-level attribute of the pinecone package, we will have to create an instance of pinecone via the pinecone library itself as follows.
from pinecone import Pinecone
# Creating a Pinecone instance
pc = Pinecone(api_key = os.environ["PINECONE_API_KEY"], environment = os.environ["PINECONE_API_ENV"])
index_name = "XYZ"
Now, when you would try to add the text chunks to the given index, it would again throw an error saying list_indexes()
are no longer a top-level attribute of the pinecone package, as the from_texts()
method would try to use this functionality and throw an error. To work around that, we will have to import Pinecone again, but this time using the langchain_pinecone library. The same can be seen as shown below:
After running the code from store_index.py file
pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_API_ENV)
It shows the given error:-
Traceback (most recent call last): File "C:\Users\vedan\Downloads\kuch bhi\End-to-end-Medical-Chatbot-using-Llama2\store_index.py", line 21, in
pinecone.init(api_key=PINECONE_API_KEY,
File "C:\Users\vedan\AppData\Roaming\Python\Python312\site-packages\pinecone\deprecation_warnings.py", line 38, in init
raise AttributeError(msg)
AttributeError: init is no longer a top-level attribute of the pinecone package.
Please create an instance of the Pinecone class instead.
Example:
Can you pls help me find the error as init is no longer supported by Pinecone.