AttributeError: module ‘requests’ has no attribute ‘exceptions’

I am getting this error while trying to use google cloud module in python for uploading image in firebase:

 from google.cloud import _helpers

  File ~\anaconda3\lib\site-packages\google\cloud\_helpers.py:32 in <module>
    import google.auth.transport.requests

  File ~\anaconda3\lib\site-packages\google\auth\transport\requests.py:78 in <module>
    class TimeoutGuard(object):

  File ~\anaconda3\lib\site-packages\google\auth\transport\requests.py:92 in TimeoutGuard
    def __init__(self, timeout, timeout_error_type=requests.exceptions.Timeout):

AttributeError: module 'requests' has no attribute 'exceptions'  

I have tried to upgrade the request module but I am getting this error :


(base) C:\Users\Admin>pip install requests --upgrade
Requirement already satisfied: requests in c:\users\admin\anaconda3\lib\site-packages (2.29.0)
Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 152 kB/s
Requirement already satisfied: idna<4,>=2.5 in c:\users\admin\anaconda3\lib\site-packages (from requests) (3.3)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\admin\anaconda3\lib\site-packages (from requests) (1.26.9)Requirement already satisfied: certifi>=2017.4.17 in c:\users\admin\anaconda3\lib\site-packages (from requests) (2021.10.8)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\admin\anaconda3\lib\site-packages (from requests) (2.0.4)
Installing collected packages: requests
  Attempting uninstall: requests
    Found existing installation: requests 2.29.0
    Uninstalling requests-2.29.0:
      Successfully uninstalled requests-2.29.0
***ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
conda-repo-cli 1.0.4 requires pathlib, which is not installed.
anaconda-project 0.10.2 requires ruamel-yaml, which is not installed.
pyrebase4 4.7.1 requires requests<2.30,>=2.19.1, but you have requests 2.31.0 which is incompatible.***
Successfully installed requests-2.31.0

How can i solve the problem related to module ‘requests’?

  • site-packages\google\auth\transport\requests.py Looks like the google module has its own internal submodule that is also named requests, and that is the one being used.

    – 

Leave a Comment