gauravsacc / MMM-GoogleAssistant

Google Assistant module for magic mirror https://github.com/MichMich/MagicMirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named 'PubNub'

btw1004 opened this issue · comments

I'm aware this issue has been touched on already but even after following all those possible solutions I'm still left with the same error.
Traceback (most recent call last):
File "/home/pi/assistant.py", line 31, in
from PubNub.callbacks import SubscribeCallback
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
module = self._original_import(*args, **kw)
ImportError: No module named 'pubnub'

Can somebody please help me, I've literally spend the past 4 days on this and I can't fix it for the life of me.

Hi. To solve your problem you need to install pubnub.
first of all activate python (for example from your home directory) : source env/bin/activate
Then : pip install pubnub
It do the job for me.... GL
Do

Another tip was useful for me, the async method seems to be depreciated in python 3.
Replace async from the assistant.py file by pn_async (three times).

@Nairod26 it doesnt work now :( can you please give me the new assistant.py file?

@Nairod26 thank you so much. but i still get the same error..
/home/pi/env/bin/python3 -u assistant.pyTraceback (most recent call last):
File "assistant.py", line 27, in
from google.assistant.library import Assistant
ImportError: No module named 'google.assistant.library'

can you help me with it?
NOTE: The sample code runs:
Press Enter to send a new request...
INFO:root:Recording audio request.
INFO:root:Transcript of user request: "what".
INFO:root:Transcript of user request: "what is".
INFO:root:Transcript of user request: "what is the".
INFO:root:Transcript of user request: "what is the mean".
INFO:root:Transcript of user request: "what is the meaning".
INFO:root:Transcript of user request: "what is the meaning of".
INFO:root:Transcript of user request: "what is the meaning of lifx".
INFO:root:Transcript of user request: "what is the meaning of life".
INFO:root:Transcript of user request: "what is the meaning of life".
INFO:root:Transcript of user request: "what is the meaning of life".
INFO:root:End of audio request detected.
INFO:root:Stopping recording.

Also don't forget to delete your pubnub keys before giving the file.

nevermind.. its working now..
all i did was i installed assistant in the env mode
pip3 install google-assistant-library==0.1.0

:D it works grreat now