frenck / python-radios

Asynchronous Python client for the Radio Browser API
MIT License
14 stars 1 forks source link

The 'pycountry' distribution was not found and is required by the application #140

Closed Whytey closed 2 years ago

Whytey commented 2 years ago

Problem/Motivation

Trying to configure the Radio Browser in Home-Assistant, I get an error. Looking in the logs, it seems to be caused by an issued with this library.

Expected behavior

Radio-Browser is installed in Home-Assistant, which would cause the radios dependency to be installed correctly. I am not sure this is happening.

Actual behavior

2022-07-03 22:53:45 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.radio_browser.config_flow
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/local/lib/python3.9/dist-packages/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/dist-packages/homeassistant/components/radio_browser/__init__.py", line 4, in <module>
    from radios import RadioBrowser, RadioBrowserError
  File "/opt/homeassistant/deps/lib/python3.9/site-packages/radios/__init__.py", line 8, in <module>
    from .models import Country, Language, Station, Stats, Tag
  File "/opt/homeassistant/deps/lib/python3.9/site-packages/radios/models.py", line 7, in <module>
    import pycountry
  File "/opt/homeassistant/deps/lib/python3.9/site-packages/pycountry/__init__.py", line 13, in <module>
    __version__ = pkg_resources.get_distribution("pycountry").version
  File "/usr/local/lib/python3.9/dist-packages/pkg_resources/__init__.py", line 477, in get_distribution
    dist = get_provider(dist)
  File "/usr/local/lib/python3.9/dist-packages/pkg_resources/__init__.py", line 353, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/local/lib/python3.9/dist-packages/pkg_resources/__init__.py", line 897, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.9/dist-packages/pkg_resources/__init__.py", line 783, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycountry' distribution was not found and is required by the application
2022-07-03 22:53:45 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration radio_browser: Exception importing homeassistant.components.radio_browser.config_flow

Steps to reproduce

Not sure if this is only reproducible in my system.

root@hass:/opt/homeassistant# uname -a
Linux hass 5.4.0-117-generic #132-Ubuntu SMP Thu Jun 2 00:39:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@hass:/opt/homeassistant# python3 --version
Python 3.9.10
root@hass:/opt/homeassistant# hass --version
2022.6.7
root@hass:/opt/homeassistant# 

Proposed changes

Unsure.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!