GeezerVison is showing github.com — pip install google-auth did not install requests dependency · Issue #1069 · googleapis/google-auth-library-python
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.
pip install google-auth did not install requests dependency #1069Labels priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionOnce recognized, this was trivially mitigated by running pip install requests, so no support is needed.
Environment details
- OS: Linux experimental-1 5.10.0-14-cloud-amd64 Internal transport discussion #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 (Cloud Compute Engine instance)
- Python version: Python 3.9.2
- pip version: pip 20.3.4
google-auth version: 2.8.0
Steps to reproduce
- Setup new clean python environment:
sudo apt update
sudo apt install python3 python3-dev python3-venv
sudo apt-get install wget
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
python3 -m venv env
source env/bin/activate
pip install --upgrade google-auth
- Run python and try to import;
python3
>>> import google.oauth2.id_token
- Exception results:
Traceback (most recent call last):
File "/home/bramsterling/tokenexpt/env/lib/python3.9/site-packages/google/auth/transport/requests.py", line 26, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/bramsterling/tokenexpt/env/lib/python3.9/site-packages/google/oauth2/id_token.py", line 67, in <module>
import google.auth.transport.requests
File "/home/bramsterling/tokenexpt/env/lib/python3.9/site-packages/google/auth/transport/requests.py", line 30, in <module>
six.raise_from(
File "<string>", line 3, in raise_from
ImportError: The requests library is not installed, please install the requests package to use the requests transport.
Activityadded type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2Moderately-important priority. Fix may not be included in next release. and removed on Jul 14, 2022sai-sunder-s commented on Jul 14, 2022 Thank you for raising the issue. We will check if requests was not added by default for some reason and add to dependencies list if it was just missed. clundin25 commented on Jul 21, 2022 It seems reasonable to me to add requests to the default setup.py dependencies. Alternatively we could add it as an extra similar to aiohttp.
MetadataMetadatapriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|