TL;DR: The google.cloud namespace is shadowed, almost always by the retired google-cloud meta-package. Uninstall google-cloud, force-reinstall google-cloud-pubsub, and the import works.

```text
ImportError: cannot import name 'pubsub' from 'google.cloud'
```

## Fix it

1. Remove the legacy meta-package: pip uninstall google-cloud. Expected: gone.
2. Reinstall: pip install --force-reinstall google-cloud-pubsub. Expected: clean install.
3. Verify: python -c "from google.cloud import pubsub_v1; print('ok')". Expected: ok. (pubsub_v1 is the canonical import; the pubsub alias usually works too once the namespace is fixed.)
4. Check interpreter alignment with python -m pip if it still fails.

## When this applies
- from google.cloud import pubsub fails but pip shows google-cloud-pubsub.

## When it doesn't
- pip lacks google-cloud-pubsub: install it.
- Publisher calls 403: IAM permissions, not this.

## Compatibility
- google-cloud-pubsub >= 1.0; Python 3.8+.

## Why it happens
All google-cloud-* packages share the google.cloud namespace. One legacy package with a real __init__.py breaks resolution for every submodule.

## Edge cases
- The same failure hits bigquery, storage, and every other google-cloud-* package; the fix is identical.
