ZHA not working with 0.118 Zigpy-Zigate - Unable to install package zigpy-zigate==0.7.2

============
RESOLVED - BUT POSTING FOR ANYONE ELSE WITH ISSUE

Found a GitHub Issue with similar error: https://github.com/ethereum/eth-abi/issues/131
But apparently uninstalling of typing package as mentioned only works with pip 20.0.2 or lower…

So uninstalling typing, and downgrading pip to 20.0.2 resolved the issue.

I don’t know if there will be an issue I will have to resolve down the road… but my lights work again… and that’s really all that matters at the moment :grimacing:

After upgrading to 0.118 with Home Assistant Core in a Python (3.8) VENV… Ubuntu 20
Just started looking into it, but was hoping maybe it was something stupid/simple that someone has ran into before.

2020-11-18 15:55:58 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package zigpy-zigate==0.7.2: ERROR: Command errored out with exit status 1:
   command: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5qnbw_lp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm
       cwd: None
  Complete output (42 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.8/runpy.py", line 192, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/local/lib/python3.8/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/__main__.py", line 26, in <module>
      sys.exit(_main())
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
      command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
      module = importlib.import_module(module_path)
    File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 783, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 17, in <module>
      from pip._internal.cli.req_command import RequirementCommand, with_cleanup
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 16, in <module>
      from pip._internal.index.collector import LinkCollector
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 14, in <module>
      from pip._vendor import html5lib, requests
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/requests/__init__.py", line 125, in <module>
      from . import utils
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/requests/utils.py", line 25, in <module>
      from . import certs
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/requests/certs.py", line 15, in <module>
      from pip._vendor.certifi import where
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/certifi/__init__.py", line 1, in <module>
      from .core import contents, where
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_vendor/certifi/core.py", line 12, in <module>
      from importlib.resources import path as get_path, read_text
    File "/usr/local/lib/python3.8/importlib/resources.py", line 11, in <module>
      from typing import Iterable, Iterator, Optional, Set, Union   # noqa: F401
    File "/srv/homeassistant/lib/python3.8/site-packages/typing.py", line 1357, in <module>
      class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
    File "/srv/homeassistant/lib/python3.8/site-packages/typing.py", line 1005, in __new__
      self._abc_registry = extra._abc_registry
  AttributeError: type object 'Callable' has no attribute '_abc_registry'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5qnbw_lp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the '/srv/homeassistant/bin/python3.8 -m pip install --upgrade pip' command.
2020-11-18 15:55:58 ERROR (MainThread) [homeassistant.setup] Setup failed for zha: Requirements for zha not found: ['zigpy-zigate==0.7.2'].
1 Like

very different errors here, upgrading from 0.117.4 to 0.118.2:

2020-11-23 14:37:07 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package zigpy-zigate==0.7.2: ERROR: Command errored out with exit status 1:
   command: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-y0dwfzdg/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm
       cwd: None
  Complete output (14 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/__main__.py", line 23, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 5, in <module>
      import locale
    File "/usr/lib/python3.8/locale.py", line 16, in <module>
      import re
    File "/usr/lib/python3.8/re.py", line 145, in <module>
      class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-y0dwfzdg/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm Check the logs for full command output.
2020-11-23 14:37:07 ERROR (MainThread) [homeassistant.setup] Setup failed for zha: Requirements for zha not found: ['zigpy-zigate==0.7.2'].
2020-11-23 14:37:07 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of zha_map. Setup failed for dependencies: zha

However, https://stackoverflow.com/questions/43124775/why-python-3-6-1-throws-attributeerror-module-enum-has-no-attribute-intflag suggests this might be related to my having enum34 installed - so uninstalled enum34:

pip3 uninstall -y enum34
Found existing installation: enum34 1.1.6
Uninstalling enum34-1.1.6:
  Successfully uninstalled enum34-1.1.6

retry zigpy:

pip3 install --upgrade zigpy-zigate
Collecting zigpy-zigate
  Using cached zigpy-zigate-0.7.3.tar.gz (23 kB)
Requirement already satisfied, skipping upgrade: pyserial-asyncio in /srv/homeassistant/lib/python3.8/site-packages (from zigpy-zigate) (0.4)
Collecting pyusb
  Using cached pyusb-1.1.0.tar.gz (78 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-3c7hnj8q/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm
       cwd: None
  Complete output (31 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/__main__.py", line 26, in <module>
      sys.exit(_main())
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
      command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
      module = importlib.import_module(module_path)
    File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 783, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 17, in <module>
      from pip._internal.cli.req_command import RequirementCommand, with_cleanup
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 22, in <module>
      from pip._internal.req.constructors import (
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 10, in <module>
      from .req_install import InstallRequirement
    File "/srv/homeassistant/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 10, in <module>
      import uuid
    File "/srv/homeassistant/lib/python3.8/site-packages/uuid.py", line 138
      if not 0 <= time_low < 1<<32L:
                                  ^
  SyntaxError: invalid syntax
  ----------------------------------------
ERROR: Command errored out with exit status 1: /srv/homeassistant/bin/python3.8 /srv/homeassistant/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-3c7hnj8q/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=30.3.0' wheel setuptools_scm Check the logs for full command output.

so now try uninstalling uuid

pip3 uninstall -y uuid
Found existing installation: uuid 1.30
Uninstalling uuid-1.30:
  Successfully uninstalled uuid-1.30

and zigpy again:

pip3 install --upgrade zigpy-zigate
Collecting zigpy-zigate
  Using cached zigpy-zigate-0.7.3.tar.gz (23 kB)
Requirement already satisfied, skipping upgrade: pyserial-asyncio in /srv/homeassistant/lib/python3.8/site-packages (from zigpy-zigate) (0.4)
Collecting pyusb
  Using cached pyusb-1.1.0.tar.gz (78 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied, skipping upgrade: zigpy>=0.22.2 in /srv/homeassistant/lib/python3.8/site-packages (from zigpy-zigate) (0.27.0)
Requirement already satisfied, skipping upgrade: pyserial in /srv/homeassistant/lib/python3.8/site-packages (from pyserial-asyncio->zigpy-zigate) (3.4)
Requirement already satisfied, skipping upgrade: pycryptodome in /srv/homeassistant/lib/python3.8/site-packages (from zigpy>=0.22.2->zigpy-zigate) (3.9.8)
Requirement already satisfied, skipping upgrade: aiohttp in /srv/homeassistant/lib/python3.8/site-packages (from zigpy>=0.22.2->zigpy-zigate) (3.7.1)
Requirement already satisfied, skipping upgrade: aiosqlite in /srv/homeassistant/lib/python3.8/site-packages (from zigpy>=0.22.2->zigpy-zigate) (0.16.0)
Requirement already satisfied, skipping upgrade: crccheck in /srv/homeassistant/lib/python3.8/site-packages (from zigpy>=0.22.2->zigpy-zigate) (0.6)
Requirement already satisfied, skipping upgrade: voluptuous in /srv/homeassistant/lib/python3.8/site-packages (from zigpy>=0.22.2->zigpy-zigate) (0.12.0)
Requirement already satisfied, skipping upgrade: chardet<4.0,>=2.0 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (3.0.4)
Requirement already satisfied, skipping upgrade: async-timeout<4.0,>=3.0 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (3.0.1)
Requirement already satisfied, skipping upgrade: typing-extensions>=3.6.5 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (3.7.4.1)
Requirement already satisfied, skipping upgrade: yarl<2.0,>=1.0 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (1.4.2)
Requirement already satisfied, skipping upgrade: attrs>=17.3.0 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (19.3.0)
Requirement already satisfied, skipping upgrade: multidict<7.0,>=4.5 in /srv/homeassistant/lib/python3.8/site-packages (from aiohttp->zigpy>=0.22.2->zigpy-zigate) (4.5.2)
Requirement already satisfied, skipping upgrade: idna>=2.0 in /srv/homeassistant/lib/python3.8/site-packages (from yarl<2.0,>=1.0->aiohttp->zigpy>=0.22.2->zigpy-zigate) (2.8)
Building wheels for collected packages: zigpy-zigate, pyusb
  Building wheel for zigpy-zigate (setup.py) ... done
  Created wheel for zigpy-zigate: filename=zigpy_zigate-0.7.3-py3-none-any.whl size=22510 sha256=e03acb52bb523d565e9a98bbc250850f3ac4a3cec428795e53742a9445a2ca75
  Stored in directory: /home/homeassistant/.cache/pip/wheels/64/f7/f9/7552a4b420ce23d00d8ad0a37f9ca1dec23aaa43ba69f03996
  Building wheel for pyusb (PEP 517) ... done
  Created wheel for pyusb: filename=pyusb-1.1.0-py3-none-any.whl size=58009 sha256=1308e3b5936529443db0816686a1217e9d603c9867c3be8a1b1858f6fad21079
  Stored in directory: /home/homeassistant/.cache/pip/wheels/c5/ab/d8/68f0e719235c5a5f5b0ddb3ef12f3cbe7e2c2706ff56f3f26b
Successfully built zigpy-zigate pyusb
Installing collected packages: pyusb, zigpy-zigate
  Attempting uninstall: zigpy-zigate
    Found existing installation: zigpy-zigate 0.6.2
    Uninstalling zigpy-zigate-0.6.2:
      Successfully uninstalled zigpy-zigate-0.6.2
Successfully installed pyusb-1.1.0 zigpy-zigate-0.7.3

now works.