alaudet / raspi-sump

A sump pump monitoring system using Python and Raspberry Pi
https://www.linuxnorth.org/raspi-sump/
MIT License
92 stars 36 forks source link

[RaspberryPi OS Bullseye]: matplotlib.dates' has no attribute 'strpdate2num' #73

Closed cjdock closed 2 years ago

cjdock commented 2 years ago

Graphs are not able to be created for the website.. Looks like the csv file is not able to be read even though it has the typical date and level data in it.

sudo /usr/local/bin/rsumpwebchart.py Traceback (most recent call last): File "/usr/local/bin/rsumpwebchart.py", line 11, in from raspisump import webchart File "/usr/local/lib/python3.9/dist-packages/raspisump/webchart.py", line 13, in from raspisump import todaychart File "/usr/local/lib/python3.9/dist-packages/raspisump/todaychart.py", line 105, in bytes2str = bytesdate2str('%H:%M:%S') File "/usr/local/lib/python3.9/dist-packages/raspisump/todaychart.py", line 52, in bytesdate2str strconverter = mdates.strpdate2num(fmt) AttributeError: module 'matplotlib.dates' has no attribute 'strpdate2num'

alaudet commented 2 years ago

From the python version it looks to me like you are running Raspberry Pi OS (bullseye). I have some work to do to test on the latest version of Raspberry Pi OS. Right now it only supports Raspbian Stretch and Buster. More specifically the conflict is with the version of matplotlib that is released with bullseye.

Did you install matplotlib with apt or with pip? What version are you running.

I dont have a quick solution for you as I need to install bullseye and recreate the problem. But I guess I will start seeing this more often now.

If you absolutely need to get this going asap you may want to format another card using buster until I can test and release something that works on the latest version of matplotlib.

cjdock commented 2 years ago

Thanks for the fast reply! Yes this is on bullseye. I installed matplotlib with pip. Version matplotlib: 3.3.4 At least my alerts and notifications still work fine with your software. Thank you for creating this software as well. I have a very high water table and my sumps run like mad and I really like being able to know if there is an issue before there is an issue. Thanks!

On Tue, Dec 28, 2021 at 9:45 AM Al Audet @.***> wrote:

From the python version it looks to me like you are running Raspberry Pi OS (bullseye). I have some work to do to test on the latest version of Raspberry Pi OS. Right now it only supports Raspbian Stretch and Buster.

Did you install matplotlib with apt or with pip? What version are you running.

I dont have a quick solution for you as I need to install bullseye and recreate the problem. But I guess I will start seeing this more often now.

If you absolutely need to get this going asap you may want to format another card using buster until I can test and release something that works on the latest.

— Reply to this email directly, view it on GitHub https://github.com/alaudet/raspi-sump/issues/73#issuecomment-1002139059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2F4FJ4ZKHC7JWOG5M4DM3UTHESDANCNFSM5K4BALCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

alaudet commented 2 years ago

Thank you very much for reporting this issue. I am going to rename it and leave it active until I get this fixed. In the meantime you could always try downgrading your matplotlib to version 3.0.2. which should also install numpy 1.16.2.

Pip can be a real hassle with matplotlib though so your mileage may vary. I have not tested it so it may not even work. Just something you can try. The best solution for now is to downgrade to Buster and reinstall Raspisump and matplotlib using apt-get instead of pip.

cjdock commented 2 years ago

Will do, thanks!

On Tue, Dec 28, 2021 at 10:38 AM Al Audet @.***> wrote:

Thank you very much for reporting this issue. I am going to rename it and leave it active until I get this fixed. In the meantime you could always try downgrading your matplotlib version 3.0.2. which should also install numpy 1.16.2.

Pip can be a real hassle with matplotlib though so your mileage may vary.

— Reply to this email directly, view it on GitHub https://github.com/alaudet/raspi-sump/issues/73#issuecomment-1002163335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2F4FKAX6LWE2KKJZHTBMDUTHKZBANCNFSM5K4BALCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

cjdock commented 2 years ago

Oh, I'm incorrect on how I installed it, I used sudo apt-get install python3-matplotlib, not pip.

On Tue, Dec 28, 2021 at 10:49 AM Chuck Dock @.***> wrote:

Will do, thanks!

On Tue, Dec 28, 2021 at 10:38 AM Al Audet @.***> wrote:

Thank you very much for reporting this issue. I am going to rename it and leave it active until I get this fixed. In the meantime you could always try downgrading your matplotlib version 3.0.2. which should also install numpy 1.16.2.

Pip can be a real hassle with matplotlib though so your mileage may vary.

— Reply to this email directly, view it on GitHub https://github.com/alaudet/raspi-sump/issues/73#issuecomment-1002163335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2F4FKAX6LWE2KKJZHTBMDUTHKZBANCNFSM5K4BALCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

alaudet commented 2 years ago

Issue has been recreated on a fresh install of bullseye. An deprecated attribute in matplotlib.dates ('strpdate2num') has been removed from version 3.3.x. This attribute handles the changing of the date format from a string so that matplotlib sees it in the proper format.

Just a matter of taking time now to fix this issue and test to make sure everything still works against buster and stretch as well. Since Stretch is supported until the end of June 2022 the fix needs to not break anything on that version.

I recommend Raspbian Buster until further notice.

cjdock commented 2 years ago

Good deal. I'll restage using Stretch for now. Its a simple process as you know and works fine. Thanks for looking into this!

On Wed, Dec 29, 2021 at 8:59 AM Al Audet @.***> wrote:

Issue has been recreated on a fresh install of bullseye. An deprecated attribute in matplotlib.dates ('strpdate2num') has been removed from version 3.3.x. This attribute handles the changing of the date format from a string so that matplotlib sees it in the proper format.

Just a matter of taking time now to fix this issue and test to make sure everything still works against buster and stretch as well. Since Stretch is supported until the end of June 2022 the fix needs to not break anything on that version.

— Reply to this email directly, view it on GitHub https://github.com/alaudet/raspi-sump/issues/73#issuecomment-1002607401, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2F4FJ46A7XD7G4WUMTNR3UTMH2PANCNFSM5K4BALCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

alaudet commented 2 years ago

I recommend Buster at the very least as Stretch support ends in June of 2022.

cjdock commented 2 years ago

Ah, ok. Will do.

On Wed, Dec 29, 2021 at 10:13 AM Al Audet @.***> wrote:

I recommend Buster at the very least as Stretch support ends in June of 2022.

— Reply to this email directly, view it on GitHub https://github.com/alaudet/raspi-sump/issues/73#issuecomment-1002641984, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2F4FJVKVLHIBW5EQBBUILUTMQRLANCNFSM5K4BALCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

alaudet commented 2 years ago

Released Version 1.3 of Raspi-Sump which adds support for Raspberry Pi OS 11 (codenamed Bullseye). This version of Raspberry Pi OS uses Python 3.9 and Matplotlib 3.3.4.

Upgrade with the following

sudo pip3 install --no-binary :all: raspisump