GUI-O on Raspberry Pi 5
-
I have been following the example GUI-O and Boards - Raspberry Pi in order to install GUI-O onto my (new) RPi 5. (Details-Debian GNU/Linux , Version 12 Bookworm (aarch64))
However, when trying to install the Python modules per the document ($ pip install paho-mqtt), I get the following error:
"error: externally managed-environment
This environment is externally managed
To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install."So I tried $apt install python3-paho-mqtt that resulted in different errors (Could not open lock file .... , and Unable to acquire the dpkg frontend lock .....)
I have no idea where to go from here and would appreciate if someone might be able to give me a clue what I should do!
Has anyone successfully installed on RPi 5?
Cheers Steve -
@SteveV Hi.
First, try to reboot the RPi and retry.
If this does not work, try running the commands with sudo, e.g.:
sudo apt install python3-paho-mqtt
Regards,
Kl3m3n -
Hi Kl3m3n,
Thanks for your response.
I had already done both this you suggested prior to my earlier post, however neither allowed installation of paho-mqtt.I checked the web for problem and found that if I used :-
$ pip install paho-mqtt --break-system-packagesthe python modules successfully installed.
Cheers -
Hi Ki3m3n,
I progressed to step 4 in GUI-O and Boards - Raspberry Pi - Setting up Pi OS,
and completed each step up to step 6 however, running the now modified RPiMqtt.py resulted in the following error response:////////////////////////////////
slv05@raspberrypi:~/Projects/Mqtt $ python ./RPiMqtt.py
Traceback (most recent call last):
File "/home/slv05/Projects/Mqtt/./RPiMqtt.py", line 87, in <module>
mqttClient = mqtt.Client(str(uuid.uuid4()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/slv05/.local/lib/python3.11/site-packages/paho/mqtt/client.py", line 772, in init
raise ValueError(
ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details
slv05@raspberrypi:~/Projects/Mqtt $
\\\\\\\\\\\\\\\\I didn't progress any further as I suspected things might go awry if the RPiMqtt.py wasn't working properly.
Can you identify what the problem might be?
I double checked the In and Out tokens within the modified RPiMqtt.py file on the RPi and all OK.
Incidentally, what would have I seen on the RPi if the RPiMqtt.py had worked?
-
@SteveV said in GUI-O on Raspberry Pi 5:
Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.
Hi, try changing:
mqttClient = mqtt.Client(str(uuid.uuid4()))
to:
mqttClient = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, str(uuid.uuid4()))
in RPiMqtt.py.
Source:
https://stackoverflow.com/questions/77984857/paho-mqtt-unsupported-callback-api-version-errorI will try to update the script ASAP.
Best regards,
Klemen -
Hi Klemen,
Thank you so much for responding to my previous post.
The change you suggested fixed the issue and I successfully completed the demo example.
I appreciate your help (as I'm sure others do), especially in this 'initial' phase of learning new programs and new technologies.
Your examples are extremely well thought out and easy to follow - unfortunately sometimes an error pops-up that stumps a 'newbie' like me and we need to call for your help!
Best Regards
Steve -
No problem! Thanks for the feedback
If you have any more issues, feel free to ask!
Best regards,
Klemen