Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing tzdata preventing launch after update #3340

Open
ImThePoolBoy opened this issue May 29, 2024 · 4 comments
Open

Missing tzdata preventing launch after update #3340

ImThePoolBoy opened this issue May 29, 2024 · 4 comments

Comments

@ImThePoolBoy
Copy link

Headphones failing to start after most recent update. Git install on Windows 10, updated through headphones webui, git status and pull confirm up-to-date with master branch.

Attempting to start from prompt gives following errors/exceptions:
ModuleNotFoundError: No module named 'tzdata'
During handling of the above exception, another exception occurred:
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key America/New_York'

Possibly related to tzlocal migration?

@milkweedsteve
Copy link

milkweedsteve commented May 31, 2024

Same experience as @ImThePoolBoy but in W11 and also tried a fresh install from master branch with the same results. Is this due to a Windows change? Maybe time to try the docker image. :)

Traceback (most recent call last):
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\zoneinfo\_common.py", line 12, in load_tzdata
    return importlib.resources.open_binary(package_name, resource_name)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\importlib\resources.py", line 43, in open_binary
    package = _common.get_package(package)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 66, in get_package
    resolved = resolve(package)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 57, in resolve
    return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\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 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tzdata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\Headphones.py", line 27, in <module>
    from headphones import webstart, logger
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\headphones\__init__.py", line 68, in <module>
    SCHED = BackgroundScheduler()
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\lib\apscheduler\schedulers\base.py", line 87, in __init__
    self.configure(gconfig, **options)
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\lib\apscheduler\schedulers\base.py", line 131, in configure
    self._configure(config)
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\lib\apscheduler\schedulers\background.py", line 29, in _configure
    super(BackgroundScheduler, self)._configure(config)
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\lib\apscheduler\schedulers\base.py", line 701, in _configure
    self.timezone = astimezone(config.pop('timezone', None)) or get_localzone()
  File "C:\Users\me\Downloads\Headphones\rembo10-headphones-abac9b5\lib\tzlocal\win32.py", line 129, in get_localzone
    _cache_tz = zoneinfo.ZoneInfo(get_localzone_name())
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\zoneinfo\_common.py", line 24, in load_tzdata
    raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key America/Chicago'

@rembo10
Copy link
Owner

rembo10 commented Jun 1, 2024

Hey so I'm just trying to figure out the best way to do this. tzdata brings in ~2.6mb, and we already have pytz in the libs, which the current version of apscheduler depends on (but the current alpha versions are moving to tzlocal....). So I'd like to just do a swap but maybe it makes more sense to wait for a proper release...

In the meantime I think you can just 'pip install tzdata', since I guess Windows doesn't include IANA timezone data...
Or you can grab this package, extract it, and move the tzdata folder into the headphones-source/lib/ directory...

But I'll figure something out in the next day or so...

@milkweedsteve
Copy link

Thank you @rembo10, downloading that pkg worked perfectly and got HP back up and running for me.

Your efforts are greatly appreciated.

@ImThePoolBoy
Copy link
Author

Worked for me as well. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants