Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this a new bug in the Pinecone Python client? #286

Closed
2 tasks
Si-za1 opened this issue Jan 17, 2024 · 3 comments
Closed
2 tasks

Is this a new bug in the Pinecone Python client? #286

Si-za1 opened this issue Jan 17, 2024 · 3 comments

Comments

@Si-za1
Copy link

Si-za1 commented Jan 17, 2024

  • I believe this is a new bug in the Pinecone Python Client
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior
I have Pinecone upgraded to v3.0.0 and also installed the GRPC client.

When I run the following command:

pinecone.init(api_key="API_KEY", environment="ENV")

I get the following error:

AttributeError: module 'pinecone' has no attribute 'init'

Expected Behavior
Previously the same code was perfectly running in the Google Colab with no issue. But, today suddenly this issue arrived.

Methods Tried:
When further researching, some searches suggested re-installing the pinecone-client, and installing the v3.0.0, but none of the solutions worked.

Environment

- Google Colab:
- Python: 3.10.12
- pinecone: 3.0.0
-openai: 0.27.7 
@sunxivincent
Copy link

+1 deploy AWS python image public.ecr.aws/lambda/python:3.11 running into same issue

@gdj0nes
Copy link
Contributor

gdj0nes commented Jan 17, 2024

The v3 version of the client has breaking changes. Here's the migration guide.

@jhamon
Copy link
Collaborator

jhamon commented Jan 19, 2024

Yes, the .init() method is no longer used in v3.0.0. Instead you should instantiate a client instance like this:

from pinecone import Pinecone

pc = Pinecone(api_key='YOUR_API_KEY')

# Now do stuff
pc.describe_index('my_index')

This approach encapsulates configuration state in the class instance so that people can work with multiple pinecone projects from the same app, if they wish.

I'm going to try to add some better warning messages to help give better guidance on the necessary migration.

@jhamon jhamon closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants