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 using python3 #15

Open
morrolinux opened this issue Jan 23, 2018 · 13 comments
Open

AttributeError using python3 #15

morrolinux opened this issue Jan 23, 2018 · 13 comments

Comments

@morrolinux
Copy link

Hello, when i use

python gassistant.py models/ok_google.pmdl
I get:
AttributeError: module 'google.assistant.embedded.v1alpha1.embedded_assistant_pb2' has no attribute 'EmbeddedAssistantStub'
PS: i had to install libpython3.4

@ghost
Copy link

ghost commented Jan 25, 2018

Just on a side note, how did you install libpython3.4. im stuck there.

Update
sudo apt-get install libpython3.4

Ok after installing libpython3.4 I am also stuck here.

(env) pi@raspberrypi:~/google-assistant-hotword-raspi $ python gassistant.py models/ok_google.pmdl
Traceback (most recent call last):
File "gassistant.py", line 33, in
assistant = Assistant()
File "/home/pi/google-assistant-hotword-raspi/assistant.py", line 84, in init
self.assistant = embedded_assistant_pb2.EmbeddedAssistantStub(self.grpc_channel)
AttributeError: module 'google.assistant.embedded.v1alpha1.embedded_assistant_pb2' has no attribute 'EmbeddedAssistantStub'

@maheshyadav007
Copy link

maheshyadav007 commented Mar 16, 2018

is the above problem solved?

problem solved myself
thanks

@royka1
Copy link

royka1 commented Mar 22, 2018

How did you solve the problem? i'm struggling for day with it

@maheshyadav007
Copy link

Its not a big issue. EmbeddedAssistantStub is not in google.assistant.embedded.v1alpha1.embedded_assistant_pb2 instead it is in google.assistant.embedded.v1alpha1.embedded_assistant_pb2_grpc so change the module name in assistant.py(You need to change it in 2 places(line 84 and 190)).
After this most probably you would get one more error something like assistant helper.... For this you need to change the line 136 and 144 by replacing the function name from assistant_helpers.py which is in googlesamples.assistant.grpc . After doing these changes you should be good to go.

Hope this helps!!

@maheshyadav007
Copy link

maheshyadav007 commented Mar 23, 2018 via email

@royka1
Copy link

royka1 commented Mar 23, 2018

Thank you very much for the reply. I've tried these changes, but when i look in the assistant_helpers.py i've got less then 136 lines. It also has at the top at import the line "google.assistant.embedded.v1alpha2.embedded_assistant_pb2". When i don't change that file, it comes a bit further then before. I identifies the hotword but after that i see a lot of errors in a loop. Also tried to change that line to v1alpha1 and, but that didn't work of course.

Edit: Downloaded an older assistent_helper.py, this file i didn't have to edit. Thank you very much for your help

@maheshyadav007
Copy link

maheshyadav007 commented Mar 25, 2018 via email

@maheshyadav007
Copy link

maheshyadav007 commented Mar 25, 2018 via email

@royka1
Copy link

royka1 commented Mar 25, 2018

I'm sorry if i was not clear, but it was solved by editing the files you mentioned and downloading the older version of assistant_helper. (I've searched for it on google and took the one with "google.assistant.embedded.v1alpha1.embedded_assistant_pb2" in it)

@sburrell63
Copy link

sburrell63 commented Jun 2, 2018

I'm not following,

For this you need to change the line 136 and 144 by replacing the function name from assistant_helpers.py which is in googlesamples.assistant.grpc_

replace the function name to what?

.UPDATE Solved: Changing function calls in assistant.py lines 136 and 144 to
assistant_helpers.log_assist_request_without_audio(c)
assistant_helpers.log_assist_response_without_audio(resp)

@maheshyadav007
Copy link

maheshyadav007 commented Jun 4, 2018 via email

@sburrell63
Copy link

Yes, this worked. I updated my original post to reflect the name changes required. Thanks!

@Zacki84
Copy link

Zacki84 commented Aug 17, 2018

Hi
I have the same or simular issue, and I dont know how to solve it:
Traceback (most recent call last):
File "gassistant.py", line 33, in
assistant = Assistant()
File "/home/pi/google-assistant-hotword-raspi/assistant.py", line 84, in init
self.assistant = embedded_assistant_pb2.EmbeddedAssistantStub(self.grpc_channel)
AttributeError: 'module' object has no attribute 'EmbeddedAssistantStub'

if I take a loot in assistant.py lines 136 and 144
I have:
assistant_helpers.log_converse_request_without_audio(c)
assistant_helpers.log_converse_response_without_audio(resp)

in the previous posts you wrote to change it to:
assistant_helpers.log_assist_request_without_audio(c)
assistant_helpers.log_assist_response_without_audio(resp)
but this change nothing, still same issue.

I dont know what to do, PLEASE can you help me, thanks!

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

5 participants