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 dependency: tzdata #140

Closed
woutdenolf opened this issue Jun 1, 2023 · 2 comments
Closed

Missing dependency: tzdata #140

woutdenolf opened this issue Jun 1, 2023 · 2 comments

Comments

@woutdenolf
Copy link

Version: backports.zoneinfo 0.2.1
OS: windows 11
Python: 3.8

Reproduce:

from backports.zoneinfo import ZoneInfo
zinfo = ZoneInfo("UTC")

Backtrace:

Traceback (most recent call last):
  File "...\py3.8\lib\site-packages\backports\zoneinfo\_common.py", line 15, in load_tzdata
    return importlib_resources.open_binary(package_name, resource_name)
  File "C:\python\3.8\lib\importlib\resources.py", line 88, in open_binary
    package = _get_package(package)
  File "C:\python\3.8\lib\importlib\resources.py", line 47, in _get_package
    module = import_module(package)
  File "C:\python\3.8\lib\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 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tzdata'

Solution:

pip install tzdata

@woutdenolf
Copy link
Author

Ok I see, this is an optional dependency. I suppose this will stay optional?

@pganssle
Copy link
Owner

pganssle commented Jun 5, 2023

Yes, tzdata is only required on some operating systems (mostly Windows), and only used if it's required. This is the same as the standard library module.

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

2 participants