Fixing Pinecone NotFoundException: Index 'my-index' Not Found in Project

beginner🧠 AI Tools2026-05-17| Python 3.8+, pinecone-client 3.0.0+, Linux/macOS/Windows

Error Message

pinecone.exceptions.NotFoundException: Index 'my-index' not found in project
#pinecone#python#vector-database#troubleshooting#rag

The Error ScenarioIt happens to the best of us. You are building a RAG pipeline or a vector search tool, and everything seems fine. You have your API key, your index is visible in the dashboard, and your code looks clean. Then, you run your script and it crashes with this traceback:

pinecone.exceptions.NotFoundException: Index 'my-index' not found in project

This usually happens right when you call pc.Index("my-index"). It is a frustrating error because the Pinecone web console might show the index as "Ready," yet the Python SDK insists it does not exist.

Common Reasons Why This HappensA NotFoundException is rarely a bug in the Pinecone infrastructure. Instead, it is almost always a configuration mismatch between your local environment and the Pinecone Cloud project. Here are the most likely causes:

  • Case Sensitivity: Pinecone index names are strictly case-sensitive. If your index is named Knowledge-Base and you call pc.Index("knowledge-base"), the request will fail.- API Key Confusion: You might be using an API key from a "Development" project to try and access an index sitting in a "Production" project. Each API key is scoped to a specific project.- The "Starter" Plan Sleep Cycle: If you are on the Free Starter plan, Pinecone pauses indexes after 7 days of inactivity. A paused index often returns a 404 until it is manually resumed.- DNS Propagation: For new Serverless indexes, it can take 30 to 60 seconds for the host URL to propagate through DNS. If you try to connect the millisecond after creation, the SDK won't find it.## Quick Fix: The Visibility CheckBefore you dive into deep debugging, run this diagnostic script. It forces the SDK to tell you exactly what it can see using your current API key:
from pinecone import Pinecone

# Initialize with your current key
pc = Pinecone(api_key="YOUR_PINECONE_API_KEY")

# List all indexes this specific API key has access to
indexes = pc.list_indexes()

print(f"Found {len(indexes)} indexes:")
for idx in indexes:
    print(f"- Name: {idx.name} | Host: {idx.host}")

If your index my-index is missing from this printed list, your API key is definitely pointing to the wrong project.

Permanent Fixes### 1. Use Environment VariablesHardcoding strings is a recipe for typos. Use a .env file to manage your configuration. This ensures your local script uses the exact same strings as your production environment. If you are using SDK v3.0.0 or higher, your setup should look like this:

import os
from pinecone import Pinecone
from dotenv import load_dotenv

load_dotenv()

pc = Pinecone(api_key=os.getenv("PINECONE_API_KEY"))
index_name = os.getenv("PINECONE_INDEX_NAME")

# Defensive check: verify existence before connecting
active_names = [i.name for i in pc.list_indexes()]
if index_name not in active_names:
    print(f"Error: {index_name} not found. Available: {active_names}")
else:
    index = pc.Index(index_name)

2. Explicitly Target the Host URLSometimes the SDK's automated lookup fails due to local network or DNS issues. You can bypass the lookup by providing the full host URL found in your Pinecone dashboard. It usually looks like a long string ending in pinecone.io.

# Manual connection via host (useful for serverless troubleshooting)
index = pc.Index(name="my-index", host="https://my-index-xyz.svc.us-east-1-aws.pinecone.io")

3. Verify Project IsolationLog in to the Pinecone Console. Look at the top-left project selector. If you have multiple projects, check each one. It is incredibly common to create an index in a project named "Default" but generate an API key for a project named "Test-Project." Keys cannot cross project boundaries.

Final VerificationOnce you think you have fixed the connection, run a quick stats check. If this returns data, your connection is stable:

# Verify connection and check vector count
stats = index.describe_index_stats()
print(f"Connection successful. Total vectors: {stats['total_vector_count']}")

If describe_index_stats() returns a JSON object with dimensions and counts, you are good to go. If you still see the error, ensure your index hasn't been deleted due to a trial period expiring.

Related Error Notes