ha-google-home: Unable to install package glocaltokens==0.3.1

Describe the bug

Hi! I’m on Home Assistant 2021.7.1 and is unable to install the integration.

Version of the integration

If you are unsure about the version check the github release here.

1.5.0

Logs

Logger: homeassistant.util.package
Source: util/package.py:96
First occurred: 4.15.02 (2 occurrences)
Last logged: 4.16.05

Unable to install package glocaltokens==0.3.1: ERROR: Cannot install glocaltokens==0.3.1 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 18 (2 by maintainers)

Most upvoted comments

That would be nice if it could be solved that way. For now I’m solving the issue by having the install in the container startup command command: /bin/bash -c "apk add gcc g++; pip3 install --upgrade pip; pip3 install pymysql glocaltokens==0.3.1; /init"

Does this build glocaltokens every time the container is restarted? Surely this adds to the startup time considerably?

Yes, that will execute everytime the container is restarted. Yes, it increases the boot time significantly.

@plangenhuizen you can try to activate the same virtualenv where HA is running and install glocaltokens manually (pip install glocaltokens==0.4.0). You should get the same error with more details about where this conflict is coming from.

After updating from 2021.7.0 to 2021.7.4 it installed without any problems for me.

That would be nice if it could be solved that way. For now I’m solving the issue by having the install in the container startup command command: /bin/bash -c "apk add gcc g++; pip3 install --upgrade pip; pip3 install pymysql glocaltokens==0.3.1; /init"

I was not able to find any elaborative logs about the installation issue, however I tried @kuchel77s suggestion and installed gcc, g++ and glocaltokens manually.

I run Home Assistant Core in Docker, so after attatching to the container I ran the commands.

bash-5.1# apk add gcc g++
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
(1/8) Installing binutils (2.35.2-r1)
(2/8) Installing libatomic (10.2.1_pre1-r3)
(3/8) Installing libgphobos (10.2.1_pre1-r3)
(4/8) Installing isl22 (0.22-r0)
(5/8) Installing gcc (10.2.1_pre1-r3)
(6/8) Installing musl-dev (1.2.2-r1)
(7/8) Installing libc-dev (0.7.2-r3)
(8/8) Installing g++ (10.2.1_pre1-r3)
Executing busybox-1.32.1-r6.trigger
OK: 325 MiB in 183 packages.
bash-5.1# pip3 install glocaltokens==0.3.1
Collecting glocaltokens==0.3.1
  Downloading glocaltokens-0.3.1-py3-none-any.whl (36 kB)
Requirement already satisfied: requests<3.0.0,>=2.25.1 in /usr/local/lib/python3.9/site-packages (from glocaltokens==0.3.1) (2.25.1)
Collecting zeroconf<0.30.0,>=0.28.8
  Downloading zeroconf-0.29.0-py3-none-any.whl (55 kB)
     |████████████████████████████████| 55 kB 1.0 MB/s
Collecting grpcio-tools==1.31.0
  Downloading grpcio-tools-1.31.0.tar.gz (2.1 MB)
     |████████████████████████████████| 2.1 MB 4.8 MB/s
Collecting gpsoauth<2.0.0,>=1.0.0
  Downloading gpsoauth-1.0.0-py3-none-any.whl (6.4 kB)
Requirement already satisfied: simplejson<4.0.0,>=3.17.2 in /usr/local/lib/python3.9/site-packages (from glocaltokens==0.3.1) (3.17.3)
Requirement already satisfied: grpcio==1.31.0 in /usr/local/lib/python3.9/site-packages (from glocaltokens==0.3.1) (1.31.0)
Requirement already satisfied: six>=1.5.2 in /usr/local/lib/python3.9/site-packages (from grpcio==1.31.0->glocaltokens==0.3.1) (1.16.0)
Requirement already satisfied: protobuf<4.0dev,>=3.5.0.post1 in /usr/local/lib/python3.9/site-packages (from grpcio-tools==1.31.0->glocaltokens==0.3.1) (3.17.3)
Requirement already satisfied: pycryptodomex>=3.0 in /usr/local/lib/python3.9/site-packages (from gpsoauth<2.0.0,>=1.0.0->glocaltokens==0.3.1) (3.10.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests<3.0.0,>=2.25.1->glocaltokens==0.3.1) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests<3.0.0,>=2.25.1->glocaltokens==0.3.1) (2021.5.30)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests<3.0.0,>=2.25.1->glocaltokens==0.3.1) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.9/site-packages (from requests<3.0.0,>=2.25.1->glocaltokens==0.3.1) (4.0.0)
Requirement already satisfied: ifaddr>=0.1.7 in /usr/local/lib/python3.9/site-packages (from zeroconf<0.30.0,>=0.28.8->glocaltokens==0.3.1) (0.1.7)
Building wheels for collected packages: grpcio-tools
  Building wheel for grpcio-tools (setup.py) ... done
  Created wheel for grpcio-tools: filename=grpcio_tools-1.31.0-cp39-cp39-linux_x86_64.whl size=2356614 sha256=d9d91ed4232f1d9d94edec767dc3909ed8ada501178dad6c09e2bd8bf6d795d4
  Stored in directory: /root/.cache/pip/wheels/41/56/80/d5bd7dd80f0a99a9ecaff9f4378d29c77be591028d08f585bf
Successfully built grpcio-tools
Installing collected packages: zeroconf, grpcio-tools, gpsoauth, glocaltokens
  Attempting uninstall: zeroconf
    Found existing installation: zeroconf 0.32.1
    Uninstalling zeroconf-0.32.1:
      Successfully uninstalled zeroconf-0.32.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
python-miio 0.5.6 requires click<8,>=7, but you have click 8.0.1 which is incompatible.
python-miio 0.5.6 requires defusedxml<0.7,>=0.6, but you have defusedxml 0.7.1 which is incompatible.
netdisco 2.9.0 requires zeroconf>=0.30.0, but you have zeroconf 0.29.0 which is incompatible.
hap-python 3.5.1 requires zeroconf>=0.32.0, but you have zeroconf 0.29.0 which is incompatible.
aiohomekit 0.5.1 requires zeroconf>=0.32.0, but you have zeroconf 0.29.0 which is incompatible.
aioesphomeapi 5.0.1 requires zeroconf<1.0,>=0.32.0, but you have zeroconf 0.29.0 which is incompatible.
Successfully installed glocaltokens-0.3.1 gpsoauth-1.0.0 grpcio-tools-1.31.0 zeroconf-0.29.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

The integration didn’t fail to install afterwards.

If you have access to the command line of Home Assistant, do

apk add gcc

and

apk add g++

To add glocaltokens, it wants to build wheels grpcio-tools locally (rather than having binaries you can download already). It can’t be done if you don’t have a C or C++ compiler (gcc and g++) installed locally.

Then, you can install glocaltokens via

pip3 install glocaltokens

It takes a little bit to build it all, but it then should install it ok. It is now giving me a separate error but at least it solves the installation problem.

Just jumping in on this, I updated HA to 2021.7.4 and have been experiencing the same error in the log. I attempted to follow the instructions for more log data, but Logger: Set level (from the Service menu) does not seem to exist in my services list in Developer Tools.

Two different Log Entries Below:

Setup failed for google_home: Requirements for google_home not found: [‘glocaltokens==0.3.1’].

Unable to install package glocaltokens==0.3.1: ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-01sz4ztr/grpcio-tools/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-01sz4ztr/grpcio-tools/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ egg_info --egg-base /tmp/pip-pip-egg-info-6jdhclu9 cwd: /tmp/pip-install-01sz4ztr/grpcio-tools/ Complete output (11 lines): Traceback (most recent call last): File “<string>”, line 1, in <module> File “/tmp/pip-install-01sz4ztr/grpcio-tools/setup.py”, line 112, in <module> if check_linker_need_libatomic(): File “/tmp/pip-install-01sz4ztr/grpcio-tools/setup.py”, line 73, in check_linker_need_libatomic cc_test = subprocess.Popen([‘cc’, ‘-x’, ‘c++’, ‘-std=c++11’, ‘-’], File “/usr/local/lib/python3.9/subprocess.py”, line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File “/usr/local/lib/python3.9/subprocess.py”, line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: ‘cc’ ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. WARNING: You are using pip version 20.2.4; however, version 21.1.3 is available. You should consider upgrading via the ‘/usr/local/bin/python3 -m pip install --upgrade pip’ command.