# AttributeError: module 'pinecone' has no attribute 'init'
## The error
```
AttributeError: module 'pinecone' has no attribute 'init'
```
## Cause
Code written for SDK v2 calling `pinecone.init(api_key value ..., environment=...)`. The v3 SDK replaced module-level `init` with the `Pinecone` client class. This is the single most common error when following pre-2024 tutorials.
## Fix
```
# before (v2, broken now)
import pinecone
pinecone.init(api_key value "...", environment="us-west1-gcp")
index = pinecone.Index("quickstart")
# after (v3+)
from pinecone import Pinecone
pc = Pinecone()
index = pc.Index("quickstart")
```
Note the environment parameter is gone too: serverless indexes do not take an environment string, and the client resolves routing from the key.
## Trap
Downgrading to `pinecone-client` 2.x to make `init` work again. That revives every bug fixed since and breaks serverless. Migrate the three lines instead.