n0bel / PiClock

A Fancy Clock built around a monitor and a Raspberry Pi
MIT License
566 stars 182 forks source link

PiClock fails at PyQtPiClock.py", line 1264 #225

Closed lstew452a closed 2 years ago

lstew452a commented 2 years ago

This seems to a Dark sky issue. Please advise.

def getwx_ds(): global wxurl global wxreply print "getting current and forecast:" + time.ctime() wxurl = 'https://api.darksky.net/forecast/' + \

stylinnile commented 2 years ago

Same issue here, there a known fix?

n0bel commented 2 years ago

please show the error message.

n0bel commented 2 years ago

Also be sure the default python version is version 2, not 3.

lstew452a commented 2 years ago

please show the error message.

Setting sound to max (assuming Monitor Tv controls volume).... Checking for NeoPixels Ambilight... Checking for GPIO Buttons... Starting gpio-keys Service... Checking for Temperature Sensors... Starting PiClock.... logging to screen. File "/home/pi/PiClock/Clock/PyQtPiClock.py", line 1264 print "getting current and forecast:" + time.ctime() ^ SyntaxError: invalid syntax

BertLindeman commented 2 years ago

n0bel asked:

Also be sure the default python version is version 2, not 3.

This error looks like you are running python3 that needs "(" and ")"

How do you start the clock? And what is your default python version? In a terminal: python --version

lstew452a commented 2 years ago

i change How do the default python --version

BertLindeman commented 2 years ago

Start on the desktop a terminal session. Maybe via the application menu -> System tools -> LXterminal.

In the terminal do: python --version

Then copy the result and paste here in a reply.

lstew452a commented 2 years ago

Support for python 2.7 ended in 2019. Looks like they took it out in latest release of the OS.

stylinnile commented 2 years ago

How do I add python 2 back into Raspbian? I tried looking up but it came inconclusive

edit: I believe sudo apt-get install python2 and editing all python to python2 in the startup file worked, though I'm still receiving an error

Disabling screen blanking.... Setting sound to max (assuming Monitor Tv controls volume).... Checking for NeoPixels Ambilight... Checking for GPIO Buttons... Checking for Temperature Sensors... Starting PiClock.... logging to screen. Traceback (most recent call last): File "PyQtPiClock.py", line 8, in <module> import dateutil.parser ImportError: No module named dateutil.parser

SerBrynden commented 2 years ago

Try my fork at https://github.com/SerBrynden/PiClock

I updated the code to Python 3 and PyQt5, and it seems to run well on Raspberry Pi OS versions Buster and Bullseye. I also added an option to use custom dark maps from MapBox, with a transparent layer for labels, borders, and roads on top of the radar imagery. This way the map details are not obscured by large rain storms.

The changes to Python 3 and Qt5 have worked pretty well, but there are intermittent crashes once in a blue moon that I haven’t fixed yet.

Occasionally, there are index out of range errors with the radar image tiles. I suspect the expected number of radar tiles don’t get downloaded properly from RainViewer sometimes. I’ve also seen JSON decode errors with the OpenWeatherMaps data, segmentation faults, and messages like “python3: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.”

I would like to get rid of all the global variables from the original code too, but they're prolific.

I haven't tested every feature, such as LED lighting, background switcher, temperature sensor, GPIO buttons, or IR remote control, since I don’t use those things.

Rickinfl commented 2 years ago

Same issue. Bullseye uses PyQt 3.9 and it will not run on it. To be honest it wasn't even worth fighting getting PyQt2 on to it so I just loaded Buster and went about my day.

bl8demast3r commented 2 years ago

Wow I was just fighting to get pyqt4 working on bullseye and @SerBrynden posted a pyqt5 port. Thanks for that!

lstew452a commented 2 years ago

I tried using the PIClock and got this error. isabling screen blanking.... Setting sound to max (assuming Monitor Tv controls volume).... Checking for NeoPixels Ambilight... Checking for GPIO Buttons... Checking for Temperature Sensors... Starting PiClock.... logging to screen. Traceback (most recent call last): File "/home/pi/PiClock/Clock/PyQtPiClock.py", line 17, in from PyQt5 import QtGui, QtCore, QtNetwork, QtWidgets ModuleNotFoundError: No module named 'PyQt5'

SerBrynden commented 2 years ago

@lstew452a you need to install PyQt5, per the instructions https://github.com/SerBrynden/PiClock/blob/master/Documentation/Install.md

sudo apt-get install python3-pyqt5

lstew452a commented 2 years ago

Try my fork at https://github.com/SerBrynden/PiClock

I updated the code to Python 3 and PyQt5, and it seems to run well on Raspberry Pi OS versions Buster and Bullseye. I also added an option to use custom dark maps from MapBox, with a transparent layer for labels, borders, and roads on top of the radar imagery. This way the map details are not obscured by large rain storms.

The changes to Python 3 and Qt5 have worked pretty well, but there are intermittent crashes once in a blue moon that I haven’t fixed yet.

Occasionally, there are index out of range errors with the radar image tiles. I suspect the expected number of radar tiles don’t get downloaded properly from RainViewer sometimes. I’ve also seen JSON decode errors with the OpenWeatherMaps data, segmentation faults, and messages like “python3: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.”

I would like to get rid of all the global variables from the original code too, but they're prolific.

I haven't tested every feature, such as LED lighting, background switcher, temperature sensor, GPIO buttons, or IR remote control, since I don’t use those things.

Thanks PiClock works again

stylinnile commented 2 years ago

@SerBrynden Thanks so much it worked first try!

n0bel commented 2 years ago

I've updated the install documentation to refer to a correct version of Raspberry Pi OS that has Python2 still in it. The docs always clearly said "For Raspbian Stretch", but but links go to the current download pages, the current version of which has passed PiClock by. I'll be doing a Python 3 version soon. An older version ported to Python3 already exists on the dev branch, but it is lacking the newest features.

vanhalen26505 commented 2 years ago

Thanks so much for continuing to make this available! I have it in a bunch of screens in my house and love it!

Lee

On Thu, Dec 9, 2021 at 8:37 AM Kevin Uhlir @.***> wrote:

I've updated the install documentation to refer to a correct version of Raspberry Pi OS that has Python2 still in it. The docs always clearly said "For Raspbian Stretch", but but links go to the current download pages, the current version of which has passed PiClock by. I'll be doing a Python 3 version soon. An older version ported to Python3 already exists on the dev branch, but it is lacking the newest features.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n0bel/PiClock/issues/225#issuecomment-989859436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK4ASA56FCCR2B4CZHWKLE3UQCWIRANCNFSM5H2XICAA . 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.

-- Lee O. Silverman, M.A., Owner & Voice Talent Leecast Professional Voice-Over Services http://leecast.com

lstew452a commented 2 years ago

I had to re-install the OS n my raspberry pi and when run PIClock I get error. Traceback (most recent call last): File "/home/pi/PiClock/Clock/PyQtPiClock.py", line 15, in import dateutil.parser ModuleNotFoundError: No module named 'dateutil'