Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

error register() takes from 2 to 3 positional arguments but 4 were given #20

Open
mathieusayag opened this issue Feb 28, 2019 · 4 comments

Comments

@mathieusayag
Copy link

Created symlink /etc/systemd/system/multi-user.target.wants/AssistantPi.service → /lib/systemd/system/AssistantPi.service.
Traceback (most recent call last):
File "src/AssistantPi.py", line 8, in
assistant.main()
File "/home/pi/AIY-projects-python/src/examples/voice/assistant_library_with_local_commands_demo.py", line 83, in main
credentials = auth_helpers.get_assistant_credentials()
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 132, in get_assistant_credentials
return _try_to_get_credentials(credentials_file)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 123, in _try_to_get_credentials
credentials = _credentials_flow_interactive(client_secrets)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 75, in _credentials_flow_interactive
webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), -1)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given

@Avi-avidan
Copy link

Experiencing same issue with RPI4B+ and aiy voice HAT (voice kit v1.0)

@robbie-vonken
Copy link

robbie-vonken commented Dec 17, 2019

Also Experiencing same issue with RPI4B+ and aiy voice HAT (voice kit v1.0)

pi@robbie:~/AIY-projects-python $ src/examples/voice/assistant_library_demo.py
Traceback (most recent call last):
File "src/examples/voice/assistant_library_demo.py", line 71, in
main()
File "src/examples/voice/assistant_library_demo.py", line 64, in main
credentials = auth_helpers.get_assistant_credentials()
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 151, in get_assistant_credentials
return _try_to_get_credentials(credentials_file)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 123, in _try_to_get_credentials
credentials = _credentials_flow_interactive(client_secrets)
File "/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py", line 75, in _credentials_flow_interactive
webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'), -1)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given

image AIY Kits Release 2019-11-13

https://aiyprojects.withgoogle.com/voice/#google-assistant--run-the-assistant-demo
says:
Type the following command line and press enter:
voice/assistant_grpc_demo.py (incorrect the path is incomplete)
src/examples/voice/assistant_library_demo.py (correct)

@zxcj04
Copy link

zxcj04 commented Dec 18, 2019

provide a temporary solution:

make a backup of auth_helpers.py

modify the 75 line to "webbrowser.register('chromium-browser', None, webbrowser.Chrome('chromium-browser'))"

restart assistant_library_demo.py , it may work~

@robbie-vonken
Copy link

Thank you for this feedback
I have modified the file line 75 in:
/home/pi/AIY-projects-python/src/aiy/assistant/auth_helpers.py
and then could execute
src/examples/voice/assistant_grpc_demo.py
carry out authentication
all perfect

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

No branches or pull requests

4 participants