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

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

Open
Pkscode opened this issue Jun 25, 2022 · 1 comment
Open

Comments

@Pkscode
Copy link

Pkscode commented Jun 25, 2022

How shall I rectify this error?
getting this error on running the given line of code : blob_name=video_to_audio(video_path, "audio.wav", channels, bit_rate, sample_rate)
Tho my credentials are working fine on other projects.

AttributeError Traceback (most recent call last)
in
----> 1 blob_name=video_to_audio(video_path, "audio.wav", channels, bit_rate, sample_rate)
2 print(blob_name)

in video_to_audio(video_filepath, audio_filename, video_channels, video_bit_rate, video_sample_rate)
5 blob_name = f"{audio_filename}" #audios/
6 print(blob_name)
----> 7 upload_blob(BUCKET_NAME, audio_filename, blob_name)
8 return blob_name

in upload_blob(bucket_name, source_file_name, destination_blob_name)
5 # destination_blob_name = "storage-object-name"
6
----> 7 storage_client = storage.Client()
8 bucket = storage_client.bucket(bucket_name)
9 blob = bucket.blob(destination_blob_name)

~/.local/lib/python3.8/site-packages/google/cloud/storage/client.py in init(self, project, credentials, _http, client_info, client_options)
159 project = ""
160
--> 161 super(Client, self).init(
162 project=project,
163 credentials=credentials,

~/.local/lib/python3.8/site-packages/google/cloud/client/init.py in init(self, project, credentials, client_options, _http)
319 def init(self, project=None, credentials=None, client_options=None, _http=None):
320 _ClientProjectMixin.init(self, project=project, credentials=credentials)
--> 321 Client.init(
322 self, credentials=credentials, client_options=client_options, _http=_http
323 )

~/.local/lib/python3.8/site-packages/google/cloud/client/init.py in init(self, credentials, _http, client_options)
167 raise ValueError(_GOOGLE_AUTH_CREDENTIALS_HELP)
168
--> 169 scopes = client_options.scopes or self.SCOPE
170
171 # if no http is provided, credentials must exist

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

@russkiimike
Copy link

russkiimike commented Nov 29, 2022

Using latest google libraries solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants