Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install google-auth did not install requests dependency #1069

Closed
sterlinb opened this issue Jun 28, 2022 · 2 comments
Closed

pip install google-auth did not install requests dependency #1069

sterlinb opened this issue Jun 28, 2022 · 2 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@sterlinb
Copy link

Once 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

  1. 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
  1. Run python and try to import;
python3
>>> import google.oauth2.id_token
  1. 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.
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 29, 2022
@sai-sunder-s sai-sunder-s added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Jul 14, 2022
@sai-sunder-s
Copy link
Contributor

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
Copy link
Contributor

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.

clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Sep 1, 2022
This allows users of pip to specify a dependency on requests during the
pip install process, e.g. `pip install google-auth[requests]`.

This resolves
googleapis#1069.
clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Sep 20, 2022
This allows users of pip to specify a dependency on requests during the
pip install process, e.g. `pip install google-auth[requests]`.

This resolves
googleapis#1069.
clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Oct 14, 2022
This allows users of pip to specify a dependency on requests during the
pip install process, e.g. `pip install google-auth[requests]`.

This resolves
googleapis#1069.
clundin25 added a commit to clundin25/google-auth-library-python that referenced this issue Dec 2, 2022
This allows users of pip to specify a dependency on requests during the
pip install process, e.g. `pip install google-auth[requests]`.

This resolves
googleapis#1069.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants