Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
Stephen, On Friday, 31 December 2021 12:29:40 GMT Stephen Wolff wrote: > I think ipython is a distraction. How do you run your program? Is it with > > python app.py No. I have: #!/usr/bin/env python3 as the first line in the program, the file is made executable and I launch it with: ./minsterbells.py which I place in .bashrc. > If so what do you get when you do > > python > > (To bring up python command line, it’ll say which version of python you’re > running) pi@minster-bells:~ $ python Python 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
Hi terry, I think ipython is a distraction. How do you run your program? Is it with python app.py If so what do you get when you do python (To bring up python command line, it’ll say which version of python you’re running) > On 31 Dec 2021, at 11:51, Terry Coles wrote: > > On Friday, 31 December 2021 10:41:16 GMT Terry Coles wrote: >> Is there any penalty in getting several hundred kilobytes of Warnings >> written to the console 24/7? > > OK. I've searched through /var/log/ and there doesn't seem to be any entries > to any of the logs that were written the last time I ran the program. From > that, I'm assuming that 'used' lines in the console are simply thrown away > when they scroll off the screen. > > Is that right? If it is, then the only penalty that I can think of is the > difficulty debugging errors which are likely to get lost amongst all the > reams > of Warnings. > > -- > > > >Terry Coles > > > > -- > Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 > Check to whom you are replying > Meetings, mailing list, IRC, ... http://dorset.lug.org.uk > New thread, don't hijack: mailto:dorset@mailman.lug.org.uk -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:41:16 GMT Terry Coles wrote: > Is there any penalty in getting several hundred kilobytes of Warnings > written to the console 24/7? OK. I've searched through /var/log/ and there doesn't seem to be any entries to any of the logs that were written the last time I ran the program. From that, I'm assuming that 'used' lines in the console are simply thrown away when they scroll off the screen. Is that right? If it is, then the only penalty that I can think of is the difficulty debugging errors which are likely to get lost amongst all the reams of Warnings. -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
OK, so we've fixed the "I can't install zoneinfo" problem. I'll let someone else battle whatever the remaining problem is. -- Great music, chat and even some wit. Join me every Friday evening at 8pm for Keith's Music Box: Follow: https://www.facebook.com/KMBEngland On Friday go to: https://www.mixcloud.com/live/KeithsMusicBox/ -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:42:08 GMT Keith Edmunds wrote: > > No specific new error, just thsame as before. > > Terry, I'm trying to help you here but you need to help me. Let's try one > more time: what error do you get when you try to import zoneinfo? Keith, I hadn't tried to run it using ipython3; I was simply running my program and got no new errors; it wouldn't see below. > I get this: > > $ ipython3 > Python 3.9.2 (default, Feb 28 2021, 17:03:44) > Type 'copyright', 'credits' or 'license' for more information > IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help. > > In [1]: import zoneinfo > > In [2]: I installed ipython3 (lots of new stuff). I got: pi@minster-bells:~ $ ipython3 Python 3.9.2 (default, Mar 12 2021, 04:06:34) Type 'copyright', 'credits' or 'license' for more information IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import zoneinfo In [2]: In other words, the same as you. It would appear that the problem is in tzlocal, (see my other responses) so I'm wondering whether to downgrade or live with the Warnings. -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
> No specific new error, just thsame as before. Terry, I'm trying to help you here but you need to help me. Let's try one more time: what error do you get when you try to import zoneinfo? I get this: $ ipython3 Python 3.9.2 (default, Feb 28 2021, 17:03:44) Type 'copyright', 'credits' or 'license' for more information IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import zoneinfo In [2]: -- Great music, chat and even some wit. Join me every Friday evening at 8pm for Keith's Music Box: Follow: https://www.facebook.com/KMBEngland On Friday go to: https://www.mixcloud.com/live/KeithsMusicBox/ -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:26:25 GMT Terry Coles wrote: > The issue has been under discussion on the apscheduler github site: > > https://github.com/agronholm/apscheduler/discussions/570 > > The question is should I wait awhile or downgrade tzlocal to 2.x as > suggested in that discussion. I'm wary of downgrading things because any > future updates may be locked out. agronholm also says: You can either (safely) ignore those warnings or... Is there any penalty in getting several hundred kilobytes of Warnings written to the console 24/7? -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:38:30 GMT Keith Edmunds wrote: > I read all the replies in this thread but didn't see what error you got > when you tried to import zoneinfo. Sorry, I misread your question. No specific new error, just thsame as before. -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
I read all the replies in this thread but didn't see what error you got when you tried to import zoneinfo. -- Great music, chat and even some wit. Join me every Friday evening at 8pm for Keith's Music Box: Follow: https://www.facebook.com/KMBEngland On Friday go to: https://www.mixcloud.com/live/KeithsMusicBox/ -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:34:08 GMT Keith Edmunds wrote: > What error do you get? See my response to Hamish. -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
> when I tried to install zoneinfo it failed zoneinfo is part of the Python Standard Library, so you shouldn't need to install it. > from zoneinfo import ZoneInfo > > to the program and still got the error. What error do you get? -- Great music, chat and even some wit. Join me every Friday evening at 8pm for Keith's Music Box: Follow: https://www.facebook.com/KMBEngland On Friday go to: https://www.mixcloud.com/live/KeithsMusicBox/ -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On Friday, 31 December 2021 10:07:02 GMT Hamish McIntyre-Bhatty wrote: > Sounds a bit complicated! Yes. I found it a bit impenetrable with multiple ways to fix the problem. > What error(s) did you get when trying to install zoneinfo? Also which > ways did you try (pip, setup.py install, something else?)? I only used pip3: pi@minster-bells:~ $ pip3 install zoneinfo Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple ERROR: Could not find a version that satisfies the requirement zoneinfo ERROR: No matching distribution found for zoneinfo I'm not sure that getting this to install would actually help. I added: from zoneinfo import ZoneInfo to the program and still got the error. Presumably, if this isn't fixed then it would affect all the other Pis at WMT when we upgrade them from buster. Having said that, I would rather hope that it will be fixed in due course. The issue has been under discussion on the apscheduler github site: https://github.com/agronholm/apscheduler/discussions/570 The question is should I wait awhile or downgrade tzlocal to 2.x as suggested in that discussion. I'm wary of downgrading things because any future updates may be locked out. -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk
Re: [Dorset] I'm Having Trouble with apscheduler and pytz Under bullseye
On 31/12/2021 09:30, Terry Coles wrote: Hi, I've posted this query on the Raspberry Pi Forums, but with no response so far. As many of you are aware, I've been busy making changes to the hardware of the Music and Bells Player at the WMT. At the same time I've taken the opportunity to upgrade the OS to bullseye, which I suspect has some bearing on the issue that I've just encountered. The software to control the playing of the bells and chimes is written in Python and although the code I wrote last year is unchanged, the Python version has been upgraded to Version 3.9 as part of the changes introduced by bullseye. When I run my Bells program I get this error, which repeats every few seconds: /home/pi/.local/lib/python3.9/site-packages/apscheduler/util.py:95: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html] BTW, the program still plays the bells when needed. I use apscheduler in the program to schedule a number of events: def chimes_schedule(): # Schedule functions to be run and start the scheduler sched.add_job(hours, 'cron', hour='10') sched.add_job(hours, 'cron', hour='11') sched.add_job(hours, 'cron', hour='12') sched.add_job(hours, 'cron', hour='13') sched.add_job(hours, 'cron', hour='14') sched.add_job(hours, 'cron', hour='15') sched.add_job(hours, 'cron', hour='16') sched.add_job(hours, 'cron', hour='17') sched.add_job(hours, 'cron', hour='18') sched.add_job(hours, 'cron', hour='19') sched.add_job(hours, 'cron', hour='20') sched.add_job(hours, 'cron', hour='21') sched.add_job(hours, 'cron', hour='22') sched.add_job(resetnormalopening, 'cron', hour='23') sched.add_job(shutdown, 'cron', minute='1') sched.add_job(quarters, 'cron', minute='15') sched.add_job(quarters, 'cron', minute='30') sched.add_job(quarters, 'cron', minute='45') sched.add_job(check_minstermusic_commands, 'interval', seconds=1, id='check_minstermusic_commands') sched.start() The procedure chimes_schedule() is called once at the beginning of the program. On visiting the link given in the error message (https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html), I've found that the strategy to migrate from pytz is outlined, with 'zoneinfo' being the preferred route. However, when I tried to install zoneinfo it failed and I had to install 'backports.zoneinfo' instead. However, I still couldn't make it work and am not encouraged by: Support for backports.zoneinfo in Python 3.9+ is currently minimal, since it is expected that you would use the standard library zoneinfo module instead. Can anyone help? Would it be worth uninstalling Python 3.9 and installing an earlier version? Sounds a bit complicated! Once I've upgraded my pis to Bullseye I'll take a look. What error(s) did you get when trying to install zoneinfo? Also which ways did you try (pip, setup.py install, something else?)? Hamish -- Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk