{"id":3737,"library":"pinecone-client","title":"Pinecone Python Client (Legacy)","description":"The `pinecone-client` library is the **DEPRECATED** Python client for the Pinecone vector database, which allows users to store, search, and manage high-dimensional vectors. This package is no longer maintained, and its last version is 6.0.0. All users should migrate to the new `pinecone` package for continued support, updates, and new features. The new `pinecone` package follows a quarterly release cadence aligned with Pinecone's API versioning.","status":"deprecated","version":"6.0.0","language":"en","source_language":"en","source_url":"https://github.com/pinecone-io/pinecone-python-client","tags":["vector database","ai","ml","deprecated","client","embedding"],"install":[{"cmd":"pip install pinecone-client","lang":"bash","label":"Deprecated Client Installation"},{"cmd":"pip install \"pinecone-client[grpc]\"","lang":"bash","label":"Deprecated Client with gRPC (for performance)"}],"dependencies":[{"reason":"Required Python version for the legacy client.","package":"python","optional":false},{"reason":"Optional dependency for gRPC-based data operations, offering modest performance improvements.","package":"grpcio","optional":true},{"reason":"Dependency for gRPC functionality (was updated to address security vulnerability in newer clients).","package":"protobuf","optional":true}],"imports":[{"note":"The `pinecone.init()` function is deprecated and removed in the new `pinecone` package. Users must instantiate the `Pinecone` class directly.","wrong":"import pinecone; pinecone.init(...)","symbol":"Pinecone","correct":"from pinecone import Pinecone"}],"quickstart":{"code":"import os\nfrom pinecone import Pinecone, ServerlessSpec, CloudProvider, AwsRegion\n\n# Initialize the Pinecone client (using the new 'pinecone' package)\napi_key = os.environ.get('PINECONE_API_KEY', 'YOUR_API_KEY')\n# Ensure you have a Pinecone API Key set as an environment variable or replace 'YOUR_API_KEY'\n\npc = Pinecone(api_key=api_key)\n\nindex_name = 'my-first-index'\ndimension = 1536  # Example dimension, choose based on your embedding model\n\n# Create a serverless index (if it doesn't exist)\nif index_name not in pc.list_indexes().names():\n    pc.create_index(\n        name=index_name,\n        dimension=dimension,\n        metric='cosine', # or 'euclidean', 'dotproduct'\n        spec=ServerlessSpec(\n            cloud=CloudProvider.AWS, \n            region=AwsRegion.US_EAST_1\n        )\n    )\nprint(f\"Index '{index_name}' created or already exists.\")\n\n# Connect to the index\nindex = pc.Index(name=index_name)\n\n# Example: Upserting data (replace with your actual vectors/text)\nvectors_to_upsert = [\n    {\"id\": \"vec1\", \"values\": [0.1]*dimension, \"metadata\": {\"genre\": \"fiction\"}},\n    {\"id\": \"vec2\", \"values\": [0.2]*dimension, \"metadata\": {\"genre\": \"non-fiction\"}}\n]\nindex.upsert(vectors=vectors_to_upsert)\nprint(f\"Upserted {len(vectors_to_upsert)} vectors to '{index_name}'.\")\n\n# Example: Querying the index\nquery_vector = [0.15]*dimension\nquery_results = index.query(vector=query_vector, top_k=1, include_metadata=True)\nprint(\"Query results:\", query_results)\n\n# Example: Deleting the index (uncomment to run)\n# pc.delete_index(index_name)\n# print(f\"Index '{index_name}' deleted.\")","lang":"python","description":"This quickstart demonstrates how to initialize the **new** `pinecone` client, create a serverless index, upsert vectors, and query the index. It is crucial to use the `pinecone` package for all new development as `pinecone-client` is deprecated. Replace `YOUR_API_KEY` with your actual Pinecone API key and adjust the dimension and region as needed."},"warnings":[{"fix":"Uninstall `pinecone-client` and install the new package: `pip uninstall pinecone-client && pip install pinecone`. Update import statements from `import pinecone` to `from pinecone import Pinecone` and instantiate the client `pc = Pinecone(...)` instead of `pinecone.init(...)`.","message":"The `pinecone-client` package is DEPRECATED. The official Python client has been renamed to `pinecone`. Continuing to use `pinecone-client` will result in no further updates, bug fixes, or new features, and may lead to conflicts if both packages are installed.","severity":"breaking","affected_versions":"All versions of `pinecone-client` (especially v6.0.0 and earlier)"},{"fix":"Migrate to the class-based initialization: `from pinecone import Pinecone; pc = Pinecone(api_key='YOUR_API_KEY')`.","message":"The `pinecone.init()` function is no longer available in the new `pinecone` package (and was deprecated in later `pinecone-client` versions). Attempts to call it will result in an `AttributeError`.","severity":"breaking","affected_versions":"All versions of the `pinecone` package, and `pinecone-client` versions where deprecation warnings were issued."},{"fix":"Upgrade your Python environment to 3.10 or later before migrating to the `pinecone` package.","message":"The Python compatibility has changed. While `pinecone-client` supported Python 3.9+, the new `pinecone` SDK officially requires Python 3.10 or greater.","severity":"breaking","affected_versions":"Users of Python 3.9 with `pinecone-client` who are migrating to the new `pinecone` package."},{"fix":"Always uninstall `pinecone-client` completely before installing `pinecone`. Run `pip uninstall pinecone-client` first.","message":"Installing both `pinecone-client` and `pinecone` in the same environment can lead to confusing interactions and unexpected behavior.","severity":"gotcha","affected_versions":"All versions, when both packages are present."},{"fix":"Pass proxy and SSL configuration directly as keyword arguments to the `Pinecone` constructor (e.g., `Pinecone(api_key=..., proxy_url='...')`).","message":"The `openapi_config` parameter for client initialization was deprecated in `pinecone-client` v5.x and removed in favor of direct parameters such as `proxy_url`, `proxy_headers`, and `ssl_ca_certs`.","severity":"deprecated","affected_versions":"pinecone-client v5.x and later; new `pinecone` package does not use `openapi_config`."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}