GadgetReactor / pyHS100

Python Library to control TPLink Switch (HS100 / HS110)
Other
409 stars 128 forks source link

Failed to run "$ pyhs100" after install #199

Closed git-oliver closed 3 years ago

git-oliver commented 3 years ago

Hey,

I use the HS100 smart plug, already connected to my wifi. On my computer runs a Ubuntu16.04 with Python 3.5.2 (python3 --version) I have done the following steps with your git repo: 1) Downloading 2) execute $ sudo python3 setup.py build => SUCCESS 3) execute $ sudo python3 setup.py install => SUCCESS 4) execute $ pyhs100 or $ pyhs100 --help => FAILED The output is at [1]. Did the build & installation fail?

[1]

oliver@ubuntu:~/projekte/hs100_hack/pyHS100$ pyhs100 
Traceback (most recent call last):
  File "/usr/local/bin/pyhs100", line 33, in <module>
    sys.exit(load_entry_point('pyHS100==0.3.5', 'console_scripts', 'pyhs100')())
  File "/usr/local/bin/pyhs100", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/home/oliver/.local/lib/python3.5/site-packages/importlib_metadata/__init__.py", line 105, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/usr/local/lib/python3.5/dist-packages/pyHS100-0.3.5-py3.5.egg/pyHS100/__init__.py", line 22, in <module>
    from .discover import Discover
  File "/usr/local/lib/python3.5/dist-packages/pyHS100-0.3.5-py3.5.egg/pyHS100/discover.py", line 18, in <module>
    class Discover:
  File "/usr/local/lib/python3.5/dist-packages/pyHS100-0.3.5-py3.5.egg/pyHS100/discover.py", line 123, in Discover
    def _get_device_class(info: dict) -> Optional[Type[SmartDevice]]:
  File "/usr/lib/python3.5/typing.py", line 649, in __getitem__
    return Union[arg, type(None)]
  File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
    dict(self.__dict__), parameters, _root=True)
  File "/usr/lib/python3.5/typing.py", line 512, in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
    if super().__subclasscheck__(cls):
  File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
    for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
oliver@ubuntu:~/projekte/hs100_hack/pyHS100$
rytilahti commented 3 years ago

This project is not anymore maintained and you should use https://github.com/python-kasa/python-kasa instead of this, so I'll close this now.

To your problem, it may (or may not) have something to do with the existence of pypi package typing (see also the branch goodbye_release which is the latest release on pypi). So if typing is not installed in your environment, you could try to install it, and vice versa.

git-oliver commented 3 years ago

Thanks.. It works now with the python-kasa project (link is one comment above)