This page helps you understand and resolve common Pinecone errors.

Client connection errors

Cannot import name Pinecone from pinecone

When using an older version of the Python client (earlier than 3.0.0), trying to import the Pinecone class raises the following error:

console
ImportError: cannot import name 'Pinecone' from 'pinecone'

Upgrade the client version and try again:

Shell
pip install pinecone-client --upgrade

No attribute init

When using Python client version 3.0.0 and later, trying to initialize a client using pinecone.init(api_key='XXX, environment='XXX') raises the following error:

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

To initialize the client, import and use the Pinecone class instead:

Python
from pinecone import Pinecone

pc = Pinecone(api_key='XXX')

Using an outdated client with a serverless index

Trying to connect to a serverless index with an outdated Pinecone client (earlier than 3.0.0 for Python, earlier than 2.0.0 for Node.js) will raise errors similar to one of the following:

console
Failed to resolve 'controller.us-west-2.pinecone.io'

controller.us-west-2-aws.pinecone.io not found

Request failed to reach Pinecone while calling https://controller.us-west-2.pinecone.io/actions/whoami

"whoami" controller is not reachable: https://controller.us-west-2-aws.pinecone.io/actions/whoami

To connect to a serverless index, upgrade to the latest Python or Node.js client and try again:

Shell
# Python
pip install pinecone-client --upgrade

# Node.js
npm install @pinecone-database/pinecone@latest

Index creation errors

Missing spec parameter

Using the new API, creating an index requires passing appropriate values into the spec parameter. Without this spec parameter, the create_index method raises the following error:

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

For guidance on how to set this parameter, see Create a serverless index and Create a pod-based index.

Project contains max serverless indexes

Each project is limited to 20 serverless indexes. Trying to create more than 20 serverless indexes in a project raises the following 403 (FORBIDDEN) error:

console
This project already contains 20 serverless indexes, the maximum per project. 
Delete any unused indexes and try again, or create a new project for more serverless indexes. 
For additional help, please contact support@pinecone.io.

Delete any unused serverless indexes in the project and try again, or create a new project to hold additional serverless indexes.

Also consider using namespaces to partition vectors of the same dimensionality within a single index. Namespaces can help speed up queries as well as comply with multi-tenancy requirements.