|
Post by cdenney on Feb 18, 2022 15:50:13 GMT -8
I've been trying to setup my SkyWeather 2 according to the Assembly and Test manual.
Step3 under "Testing your SkyWeather2" says to run the script and then install the modules as they error out.
The second module that popped up as missing was MySQLdb. However, pip3 was unable to install it saying that no matching distribution was found. My google-fu found that this was apparently due to the fact that MySQLdb isn't supported by python3 and I needed to use mysqlclient instead.
I installed this and tried running the script again, but this time it didn't claim a missing module, it claimed invalid syntax on line 210 of the wirelessSensors.py script:
Traceback (most recent call last): File "SkyWeather2.py", line 25, in <module> import pclogging File "/home/pi/SDL_Pi_SkyWeather2/pclogging.py", line 26 in <module> import wirelessSensors File "/home/pi/SDL/Pi_SkyWeather2/wirelessSensors.py", line 210 mqtt_publish_single(sLine, f"F016TH/{var['channel']}") with a carrot under the final closing double quote.
Any help would be greatly appreciated.
|
|
|
Post by doxidad on Feb 18, 2022 17:49:23 GMT -8
Try sudo apt install python3-mysqldb
python3-mysqldb is only the python interface library to the mysql/maria database. You do have mysql/maria installed?
|
|
|
Post by cdenney on Feb 18, 2022 18:01:04 GMT -8
Yes, I have mysql installed (and I installed mariadb just to check if it fixed the issue). I am still getting the same error, even after installing python3-mysqldb as described.
|
|
|
Post by cdenney on Feb 19, 2022 23:47:49 GMT -8
Well, I'm not sure if this is the _only_ problem, but the direct issue was that the raspberry pi I was using had the "stretch" version of the OS installed, which came, by default, with Python 3.5. f-strings are only supported by python 3.6 and later, which was causing the syntax error, as python 3.5 didn't know how to deal with the "f"F016th/"...." string. Unfortunately, in trying to do an in-place upgrade of the OS, something got borked and I'm having to do a completely fresh install. Luckily, there wasn't anything terribly important on there.
It would be helpful if the documentation would state somewhere that python 3.6 or later is required.
|
|
|
Post by doxidad on Feb 20, 2022 5:00:31 GMT -8
Just a note - You could have just installed the latest version of python 3.x to fix the problem.
Hope you get it sorted out. I didn't think about version of python in the v3 tree just v2 <=> v3 differences.
|
|
|
Post by SDL on Feb 20, 2022 11:42:52 GMT -8
Most of the issues are stretch versus buster. On our next update of the SDL SD Card Image, we will be addressing these. We will be moving to bullseye. This may or may not help stretch.
BP
|
|