Skip to content

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

Closed

Description

@Si-za1
  • 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 

Activity

  1. sunxivincent commented on Jan 17, 2024

    @sunxivincent

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

  2. gdj0nes commented on Jan 17, 2024

    @gdj0nes
    Contributor

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

  3. jhamon commented on Jan 19, 2024

    @jhamon
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions