Conflicting Websockets Versions
.
The Debian "websockets" package is version 10.x while the version released on pip is 15.x.
The example server and client programs published for each version are incompatible with each other.
I have made slight changes to the example programmes server and client
so they run with either package version.
I prefer to use the debian packaged version, but accept that the upgrade to 15.x will eventually happen, and
don't want to be time-bombed when it does. You can check your code for version
stability by using the following sequence.
sudo dpkg --purge python3-websockets # remove version 10.x
sudo pip install --break-system-packages websockets # install current version 15.x
then check your programmes. E.G. server and client
Then, if you want, go back to apt managed packages as follows.
sudo pip uninstall --break-system-packages websockets # remove 15.x
sudo apt install python3-websockets # reinstall 10.x
The AI "Claude" was useful in helping track this incompatibility down.