Skip to content

AttributeError: 'module' object has no attribute 'OperationsStub' #1693

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

Closed
jinser opened this issue Sep 9, 2018 · 1 comment
Closed

AttributeError: 'module' object has no attribute 'OperationsStub' #1693

jinser opened this issue Sep 9, 2018 · 1 comment

Comments

@jinser
Copy link

jinser commented Sep 9, 2018

In which file did you encounter the issue?

speech/cloud-client/quickstart.py

Did you change the file? If so, how?

No, straight from cloning the project

Describe the issue

Python 2.7.6

Followed the Readme instructions (https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/speech/cloud-client) to clone the python samples and and installed dependencies.

The only requirements.txt that was ran was from speech/cloud-client/requirements.txt

However, after setting up authentication by running export GOOGLE_APPLICATION_CREDENTIALS=, I ran the command python quickstart.py.

Following error was received:
$ python quickstart.py
Traceback (most recent call last):
File "quickstart.py", line 60, in
run_quickstart()
File "quickstart.py", line 32, in run_quickstart
client = speech.SpeechClient()
File "/home/ubuntu/workspace/speech_tests/env/local/lib/python2.7/site-packages/google/cloud/speech_v1/gapic/speech_client.py", line 112, in init
credentials=credentials,
File "/home/ubuntu/workspace/speech_tests/env/local/lib/python2.7/site-packages/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py", line 73, in init
self._operations_client = google.api_core.operations_v1.OperationsClient(channel)
File "/home/ubuntu/workspace/speech_tests/env/local/lib/python2.7/site-packages/google/api_core/operations_v1/operations_client.py", line 59, in init
self.operations_stub = operations_pb2.OperationsStub(channel)
AttributeError: 'module' object has no attribute 'OperationsStub'

@engelke
Copy link
Contributor

engelke commented Dec 3, 2018

The example seems to work now under Python 2.7. The required version of google-cloud-speech was updated on September 29 in PR #1702, which might have fixed the issue. Please reopen this issue if the problem is still there with the latest version on Github. Thanks.

@engelke engelke closed this as completed Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants