## Problem

If you are using Pinecone serverless and getting the error `"AttributeError: module 'pinecone' has no attribute 'init'`, first check that you are using the latest version of the Python SDK.

You can check the version of the client by running:

```shell theme={null}
pip show pinecone
```

## Solution

Serverless requires a minimum version of 3.0. To upgrade to the latest version, run:

```shell theme={null}
# If you're interacting with Pinecone via HTTP:
pip install pinecone --upgrade

# If you're using gRPC:
# pip install "pinecone[grpc]" --upgrade
```

If you're on the right version and getting this error, you just have to make some slight changes to your code to make use of serverless. Instead of calling:

```python theme={null}
import pinecone

pinecone.init(api_key=api_key,environment=environment)
```

Use the following if you're interacting with Pinecone via HTTP requests:

```python theme={null}
from pinecone import Pinecone

pc = Pinecone(api_key=api_key)
```

Or, use the following if you're using gRPC:

```python theme={null}
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key=api_key)
```

You no longer need to specify the cloud environment your index is hosted in; the API key is all you need.

## Related pages

- [Account management](./account-management-index.md)
- [Admin](./admin-2-index.md)
- [Admin](./admin-index.md)
- [APIs](./apis-index.md)
- [Architecture](./architecture-index.md)
- [Assistants](./assistants-index.md)
- [Bring Your Own Cloud](./bring-your-own-cloud-index.md)
- [Build an assistant](./build-an-assistant-index.md)
- [Build an integration](./build-an-integration-index.md)
- [Changelog](./changelog-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
