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

./transcribe_model_selection.py --> TypeError: __init__() got an unexpected keyword argument 'file' #1654

Closed
ashrutv opened this issue Aug 25, 2018 · 7 comments
Assignees

Comments

@ashrutv
Copy link

ashrutv commented Aug 25, 2018

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/cloud-client/transcribe_model_selection.py

Did you change the file? If so, how?

No

Describe the issue

same script has worked in the past without any changes. My other personal script has started failing on importing beta speech api with the same error.

File "./transcribe_model_selection.py", line 100, in
transcribe_model_selection_gcs(args.path, args.model)
File "./transcribe_model_selection.py", line 62, in transcribe_model_selection_gcs
from google.cloud import speech_v1p1beta1 as speech
File "/Library/Python/2.7/site-packages/google/cloud/speech_v1p1beta1/init.py", line 17, in
from google.cloud.speech_v1p1beta1 import types
File "/Library/Python/2.7/site-packages/google/cloud/speech_v1p1beta1/types.py", line 21, in
from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2
File "/Library/Python/2.7/site-packages/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2.py", line 286, in
options=None, file=DESCRIPTOR),
TypeError: init() got an unexpected keyword argument 'file'

@nnegrey
Copy link
Contributor

nnegrey commented Sep 19, 2018

Hi,

Which version of the library are you currently using?

pip show google-cloud-speech

@nnegrey nnegrey self-assigned this Sep 19, 2018
@ashrutv
Copy link
Author

ashrutv commented Sep 21, 2018

Name: google-cloud-speech
Version: 0.33.0
Summary: Google Cloud Speech API client library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
Author-email: [email protected]
License: Apache 2.0
Location: /Library/Python/2.7/site-packages
Requires: google-api-core
Required-by:

@ashrutv
Copy link
Author

ashrutv commented Sep 21, 2018

upgraded to 0.36 and still same issue.

Name: google-cloud-speech
Version: 0.36.0
Summary: Google Cloud Speech API client library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
Author-email: [email protected]
License: Apache 2.0
Location: /Library/Python/2.7/site-packages
Requires: google-api-core
Required-by:

@nnegrey
Copy link
Contributor

nnegrey commented Sep 21, 2018

Huh, interesting.

Have you tried using a virtual environment to reinstall?

I'm guessing you used pip install --upgrade google-cloud-speech

Is your Python version the one that comes installed on Mac? (Trying to repeat the steps)

@nnegrey
Copy link
Contributor

nnegrey commented Sep 21, 2018

Updated that sample with the new library: #1702

How about using the v1 library. from google.cloud import speech

@ashrutv
Copy link
Author

ashrutv commented Sep 21, 2018

upgraded protobuf and now I am seeing an solvable error. Thanks for the help

@nnegrey
Copy link
Contributor

nnegrey commented Sep 21, 2018

👍

@nnegrey nnegrey closed this as completed Sep 21, 2018
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