django-gmailapi-backend icon indicating copy to clipboard operation
django-gmailapi-backend copied to clipboard

AttributeError: 'ClientOptions' object has no attribute 'scopes'

Open xdekasx opened this issue 3 years ago • 1 comments

With django-gmailapi-backend==0.2.0 I get the following error AttributeError: 'ClientOptions' object has no attribute 'scopes' if using together with google-cloud-storage.

The error is when tries to get some file from storage.

Here the traceback:

  File "/usr/local/lib/python3.7/site-packages/storages/backends/gcloud.py", line 243, in url
    blob = self.bucket.blob(name)
  File "/usr/local/lib/python3.7/site-packages/storages/backends/gcloud.py", line 128, in bucket
    self._bucket = self.client.bucket(self.bucket_name)
  File "/usr/local/lib/python3.7/site-packages/storages/backends/gcloud.py", line 121, in client
    credentials=self.credentials
  File "/usr/local/lib/python3.7/site-packages/google/cloud/storage/client.py", line 83, in __init__
    project=project, credentials=credentials, _http=_http
  File "/usr/local/lib/python3.7/site-packages/google/cloud/client.py", line 250, in __init__
    Client.__init__(self, credentials=credentials, client_options=client_options, _http=_http)
  File "/usr/local/lib/python3.7/site-packages/google/cloud/client.py", line 143, in __init__
    scopes = client_options.scopes or self.SCOPE
AttributeError: 'ClientOptions' object has no attribute 'scopes'

From what I've seen I think is related with the requirements google-auth~=1.11.2 or google-api-python-client~=1.7.11 or both, of the django-gmailapi-backend==0.2.0

In my case, using this packages ( a little bit old ) force the dependency google-cloud-core to get the version 1.4.0 causing the error.

For me, the problem is solved by forcing in my requirements.txt the version of google-cloud-core==1.3.0

Will the module be updated to use recent versions of this libraries ( google-auth, google-api-python-client ) ?

Hope it helps,

xdekasx avatar Mar 03 '21 12:03 xdekasx

Hello, a new version with updated dependencies has been released, https://pypi.org/project/django-gmailapi-backend/0.3.0/. In my quick tests it seemed to be working without issues. Let me know if it helps.

dolfim avatar Mar 17 '21 21:03 dolfim