Water Backup Logic Development

A forum for discussion on the software for the WMT River Control System
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

I was just about to reply and you beat me to it.

I've been doing a bit of research and there seems to be as many opinions for and against using sudo with pip as there are people responding to the question. Distilled into the two options however:
  • For:
    1. All other software is installed using sudo.
    2. Using sudo ensures the software is installed system wide and is therefore available for all users.
    3. Some software expects it, eg adafruit-circuitpython-ads1x15.
  • Against:
    1. The software installed using apt is curated by the package maintainer, whereas there have been instances of bad pip scripts turning up.
    2. If there is only one user, then sudoless pip install is perfectly OK.
In the case of adafruit-circuitpython-ads1x15 we should probably use sudo because Adafruit say so, but otherwise sudoless pip should be used.

Any thoughts before I publish Iss 0.17??
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Agreed, but let's test the configuration before we publish Iss 0.17 (I assume you probably just tested it, mind).

Does mysqlclient==2.0.1 solve the problem you were having before?
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

hamishmb wrote: 31/05/2022, 10:05Agreed, but let's test the configuration before we publish Iss 0.17 (I assume you probably just tested it, mind).
Not yet.
hamishmb wrote: 31/05/2022, 10:05Does mysqlclient==2.0.1 solve the problem you were having before?
I've got to go out. I'll test it when I get back.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

hamishmb wrote: 31/05/2022, 10:05Does mysqlclient==2.0.1 solve the problem you were having before?
It doesn't seem to:

Code: Select all

pi@g4bypassgatepi:~ $ pip3 install mysqlclient==2.0.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting mysqlclient==2.0.1
  Downloading https://www.piwheels.org/simple/mysqlclient/mysqlclient-2.0.1-cp37-cp37m-linux_armv6l.whl (106kB)
    100% |████████████████████████████████| 112kB 490kB/s 
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.0.1
pi@g4bypassgatepi:~ $ cd rivercontrolsystem
pi@g4bypassgatepi:~/rivercontrolsystem $ ./main.py --id="VALVE4"
Unexpected error 

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in <module>
    from . import _mysql
ImportError: libmariadb.so.3: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./main.py", line 970, in <module>
    run_standalone()
  File "./main.py", line 213, in run_standalone
    from Tools import coretools as core_tools
  File "/home/pi/rivercontrolsystem/Tools/coretools.py", line 42, in <module>
    import MySQLdb as mysql
  File "/home/pi/.local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 24, in <module>
    version_info, _mysql.version_info, _mysql.__file__
NameError: name '_mysql' is not defined


while running. Exiting...
That's exactly the same error as before.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

TerryJC wrote: 31/05/2022, 11:26

Code: Select all

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in <module>
    from . import _mysql
ImportError: libmariadb.so.3: cannot open shared object file: No such file or directory
This was the problem. Now to see if the mysqlclient version is critical.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

TerryJC wrote: 31/05/2022, 11:32This was the problem. Now to see if the mysqlclient version is critical.
It's not.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Hmm, I think the mysqlclient version might be something to do with staying compatible with the very old database software on the NAS box - I'd leave that for now.

I think some dependency must be missing, I'll have a look later today with my pi if I get some time - currently getting car serviced.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

No need. It's working. It was libmariadb that was missing.

I've added it to Iss 0.17 of the Installation Spec.
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

I've just uploaded updated issues of the Installation Specification and the Common Procedures Document to the file server.
Terry
Post Reply