There are two distinct issues here. First, pytz is officially deprecated. There is, however, a compatibility shim for those unable to immediately deprecate the usage of it in their code:
Second, simple pip install is intentionally blocked on Bookworm to keep the OS python install clean, only APT Python packages are supported for system-wide install. Instead, you need to use virtual environments (venv) for any Python packages not available through APT: http://rptl.io/venv
Code:
murph@raspberrypi:~ $ apt info python3-pytz-deprecation-shimPackage: python3-pytz-deprecation-shimVersion: 0.1.0.post0-3Priority: optionalSection: pythonSource: pytz-deprecation-shimMaintainer: Debian Python Team <team+python@tracker.debian.org>Installed-Size: 66.6 kBDepends: python3-dateutil | python3 (>> 3.6), python3:anyHomepage: https://github.com/pganssle/pytz-deprecation-shimDownload-Size: 14.4 kBAPT-Sources: http://deb.debian.org/debian bookworm/main arm64 PackagesDescription: Shims to help you safely remove pytz pytz has served the Python community well for many years, but it is no longer the best option for providing time zones. pytz has a non-standard interface that is very easy to misuse; this interface was necessary when pytz was created, because datetime had no way to represent ambiguous datetimes, but this was solved in Python 3.6, which added a fold attribute to datetimes in PEP 495. With the addition of the zoneinfo module in Python 3.9 (PEP 615), there has never been a better time to migrate away from pytz. . However, since pytz time zones are used very differently from a standard tzinfo, and many libraries have built pytz zones into their standard time zone interface (and thus may have users relying on the existence of the localize and normalize methods); this library provides shim classes that are compatible with both PEP 495 and pytz's interface, to make it easier for libraries to deprecate pytz.
Statistics: Posted by Murph9000 — Wed Sep 04, 2024 5:24 pm