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 package tzdata in requirements.txt #185

Open
DrMaxNix opened this issue Sep 2, 2024 · 7 comments
Open

Missing package tzdata in requirements.txt #185

DrMaxNix opened this issue Sep 2, 2024 · 7 comments

Comments

@DrMaxNix
Copy link

DrMaxNix commented Sep 2, 2024

When installing required packages via pip3 install -r requirements.txt on Alpine, I get this error when trying to access the /admin page:

...

  File "/usr/lib/python3.12/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 UTC'

It was easily fixed by installing the tzdata package:

pip3 install tzdata

Maybe it should be added to the requirements.txt file? Why is it not included although it seems to be auto-generated?

@tasn
Copy link
Member

tasn commented Sep 2, 2024

Yeah, it's weird that it's not included by default. Maybe it's an alpine thing? I'm not sure. It definitely works elsewhere (including our docker image).

@DrMaxNix
Copy link
Author

DrMaxNix commented Sep 2, 2024

Maybe it's because your docker image is based on python:3.11.0-alpine and I'm starting with alpine:latest and installing python on top..?

@Xiretza
Copy link
Contributor

Xiretza commented Sep 2, 2024

On Arch, this isn't a problem because zoneinfo uses the system zoneinfo files (in /usr/share/zoneinfo/) before falling back to the tzdata module (which means python -c 'import zoneinfo; zoneinfo.ZoneInfo("foo/bar")' also fails with ModuleNotFoundError: No module named 'tzdata').

@tasn
Copy link
Member

tasn commented Sep 2, 2024

@Xiretza, how should we solve this? Conditional dep in Alpine (is that possible?), or something else?

@DrMaxNix
Copy link
Author

DrMaxNix commented Sep 2, 2024

Why does it have to be conditional? Is there a problem with it being a dependency on all platforms?

@tasn
Copy link
Member

tasn commented Sep 2, 2024

It's better to not have redundant dependencies.

@Xiretza
Copy link
Contributor

Xiretza commented Sep 3, 2024

In my opinion this shouldn't be etesync's problem at all, this is a problem with Alpine's python installation. If python -c 'import zoneinfo; zoneinfo.ZoneInfo("UTC")' fails on a fresh install, then the python install is broken.

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