Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

ImportError in google.oauth2.id_token #1455

@B3QL

Description

@B3QL

Environment details

  • OS: Ubuntu 20.04.6 LTS
  • Python version: 3.11.7
  • pip version: 23.3.1
  • google-auth version: 2.26.2

Steps to reproduce

  1. Install google-auth
  2. Import google.oauth2.id_token module

Hi folks,
it looks like google.oauth2.id_token has an import time dependency of google.auth.transport.requests
https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L65

which requires a requests package
https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/transport/requests.py#L25

that's not defined as a google-auth dependency.
https://github.com/googleapis/google-auth-library-python/blob/main/setup.py#L22

The call to google.auth.transport.requests is only made once in https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L285 so the possible solution will be to move the import to runtime.

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions