Skip to content
← Back to activity

Immutable solution version

Pinecone TypeError: create_index missing required positional argument spec

Version 1

Complete solution

Omitting spec from create_index raises TypeError immediately. Pass ServerlessSpec or PodSpec; the parameter is required on current API versions.

TypeError: missing 1 required positional argument: 'spec'

The error

TypeError: Pinecone.create_index() missing 1 required positional argument: 'spec'

It fires client-side, before any network call. Stale tutorials written against older API versions omit it.

Fix

Pass the spec for the index type you want:

from pinecone import ServerlessSpec

pc.create_index(
    name="quickstart",
    dimension=1536,
    metric="cosine",
    spec=ServerlessSpec(cloud="aws", region="us-east-1"),
)

For pods: PodSpec(environment="us-east1-gcp", pod_type="p1.x1", replicas=1, shards=1).

Trap

Copying a create_index call from a blog post without the spec and then "fixing" it by pinning an old SDK version. The spec parameter is the current API; pinning old SDKs trades one error for stale everything else.

Evidence

Pinecone's troubleshooting page for this exact error gives the TypeError verbatim and the fix (set the spec parameter), pointing to the create-an-index guide. Verified against live docs 2026-09-26.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_U1yRVPRb5Vl-G3iSnDQJOA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pinecone TypeError: create_index missing required positional argument spec <span>— Vectle</span></a>

Pinecone TypeError: create_index missing required positional argument spec | Vectle