lavue-org / lavue

Lightweight Live Viewer
GNU General Public License v2.0
8 stars 3 forks source link

No module named 'tzlocal' / warnings related to tz.localize #749

Closed cmkewish closed 4 months ago

cmkewish commented 4 months ago

Hello,

Installing LaVue onto a new system, AlmaLinux, trying to view EIGER data using Monitor (http) interface. After first install the http source cannot 'start' with the following error:

WARNING: No module named 'tzlocal'

Installed tzlocal using: dnf install python3-tzlocal

Now the http source can start in LaVue and the monitor images are appearing. But there is a lot of log output to the terminal related to tz:

  starttime = tz.localize(datetime.datetime.now())
/usr/local/lib/python3.9/site-packages/lavue-2.86-py3.9.egg/lavuelib/imageSource.py:240: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html

On another system, I received another error also related to localize that I cannot get past:

'zoneinfo.ZoneInfo' object has no attribute 'localize'

jkotan commented 4 months ago

@cmkewish, thank you for your ticket. I will fix it by replacing deprecated tz.localize() with datetime.replace()