Closed r0oland closed 2 years ago
I just tried this on my WSL with Ubuntu and Python 3.8.10 with the same error message.
I'm getting this error too on Manjaro Linux, with both the pip package and the AUR package.
Also getting this on Ubuntu 21.04 installing via pip install homeassistant-cli
or sudo pip install homeassistant-cli
.
Found a workaround:
pip3 install click==8.0.4
Nevertheless this is still a valid issue.
Installed python-homeassistant-cli 0.9.4-1
on Arch Linux via AUR. Downgrading from python-click 8.1.3-1
to python-click-8.0.4-1
did not help:
```bash
$ hass-cli info
error: HomeAssistantCliError: Unexpected error retrieving information
Run with -x to see full exception information
$ hass-cli -x info
Unexpected error retrieving information
Traceback (most recent call last):
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/util/connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connection.py", line 309, in connect
conn = self._new_conn()
File "/home/flo/.local/lib/python3.10/site-packages/urllib3/connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError:
Also, when setting this up as mentioned in the README there was an error regarding the completion command:
$ source <(hass-cli completion zsh)
Usage: hass-cli [OPTIONS] COMMAND [ARGS]...
Try 'hass-cli --help' for help.
Error: No such command 'completion'.
Same as @unhandyman. I'm also getting that error from running that completion setup command.
@unhandyman Try _HASS_CLI_COMPLETE=zsh_source hass-cli completion
instead
Sorry for the delay. This does unfortunately not solve the problem.
$ _HASS_CLI_COMPLETE=zsh_source hass-cli completion
Traceback (most recent call last):
File "/usr/bin/hass-cli", line 33, in <module>
sys.exit(load_entry_point('homeassistant-cli==0.9.4', 'console_scripts', 'hass-cli')())
File "/usr/bin/hass-cli", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3.10/site-packages/homeassistant_cli/cli.py", line 210, in <module>
def cli(
File "/usr/lib/python3.10/site-packages/click/decorators.py", line 308, in decorator
_param_memo(f, OptionClass(param_decls, **option_attrs))
File "/usr/lib/python3.10/site-packages/click/core.py", line 2495, in __init__
super().__init__(param_decls, type=type, multiple=multiple, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'
@joshuaspence Thanks, this worked for me and I've put the following in my ~/.zshrc
:
source <(_HASS_CLI_COMPLETE=zsh_source hass-cli completion zsh)
@fabaff could you maybe take a look at my PR (#385)? It solves this issue.
Machine / Install
No matter what I try, when running
hass-cli info
I get the following error message: