Installing PySide on a Raspberry Pi
-
I have installed the QT Creator on my Raspberry pi, but can't seem to install PySide 6 on it using this command:
pip install pyside6-essentials
I get this error:
ERROR: Could not find a version that satisfies the requirement pyside6-essentials ERROR: No matching distribution found for pyside6-essentials
Please let me know how to install either PySide6 or any version on my Raspberry Pi that Python will recognise as well as the Qt Creator.
A related problem also exists when I tried to install pyside6-essentials onto my MacBook. The Mac software installed and I can only run Python scripts with PySide6 directly from Terminal and if I try to run it from from Qt Creator, it looks for PySide2 and not PySide6.
All help will be appreciated.
-
Hi and welcome to devnet,
You may have to built it yourself as I don't think there are pre-built binaries for that architecture on pip.
-
Thanks for the welcome. Glad to be aboard.
Looks like PySide6 is not supported on the Raspberry Pi. I was however able to get PyQt5 installed on it with this command:
sudo apt install python-pyqt5
I have a related question but this is for PySide6. I was able to install it onto my MacBook with M1 chip but can't get Visual Studio Code or the Qt Creator to run any app using PySide6. I'm able to only run the app directly from the command line in Terminal. Do you know how to get the Qt Creator and Visual Studio Code able to recognise the PySide6 installation?
-
PyQt5 is a different beast.
As for your macOS installation, how did you install it ? Virtual environment ? Conda environment ?
-
The problematic bit here might be that you are using Raspberry Pi OS (formerly known as raspbian) or any other OS that doesn't provide Qt 6 packages. On distributions like Manjaro ARM or Archlinux ARM you have pyside6 as a system package. PySide2 might be available in your OS (which is the equivalent to PyQt5) but without that information, it's only assumptions.
I recommend you to check blog post for more details the https://www.qt.io/blog/qt-for-python-details-on-the-new-6.3-release
Regarding your macOS issue it might be that you are not using the proper interpreter where you installed PySide6, can you add more details on 'Can't get Visual Studio Code or the Qt Creator to run any app using PySide6' ? Does that mean there is an error? if so, please share them.
-
Had the same issues, but now seems managed to solve it. So.. maybe it will be useful for somebody else.
-
Assume most important: had a RPI3 flashed with fresh bullseye 64bit (sure I did
apt update + apt upgrade
) . -
Followed this how-to to build qt6 for RPI3 (not sure if it's necessary, but keep to track the order)
https://github.com/kevin-strobel/qt6pi3b
There were some modifications inDockerfile
like addingUSER root
andUSER qtpi
on line 43 and on line 51 accordingly, localization issues and others.
I personally doing all this stuff for qt remote objects functionality so also added the "qtremoteobjects" module to be built. -
Just executed
pip install pyside6-essentials
and eventually it worked.
6.1.21-v8+ pi@raspberrypi:~ $ uname -a Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux pi@raspberrypi:~ $ python --version Python 3.9.2 pi@raspberrypi:~ $ cat /sys/firmware/devicetree/base/model Raspberry Pi 3 Model B Rev 1.2
I will check if it helped me to achieve expected, but seems no installation issues reported.
UPD: added one more module with
pip install PySide6-Addons
and QtRemoteObjects from pyside6 works like a charm. -