Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Installing PySide2 on Raspberry Pi



  • Hi,
    I am trying to install PySide2 on my Raspberry Pi.

    pip3 install PySide2
    

    raises an error:

    ERROR: Could not find a version that satisfies the requirement PySide2 (from versions: none)
    ERROR: No matching distribution found for PySide2
    

    Because I recently ran into problems with the config files and ssh modules, I just installed a fresh Raspbian image (version Feb 2020) but it still doesn't work. I found a couple of posts online of people experiencing the same but I haven't found a solution that worked for me yet.

    • I am using Python 3.7.5 for which a wheel should be accessible
    • I have updated and upgraded pip and the Pi to the newest versions

    Any ideas...?
    Thanks so much for help!



  • @Niagarer said in Installing PySide2 on Raspberry Pi:

    Hi,
    I am trying to install PySide2 on my Raspberry Pi.

    pip3 install PySide2
    

    raises an error:

    ERROR: Could not find a version that satisfies the requirement PySide2 (from versions: none)
    ERROR: No matching distribution found for PySide2
    

    Because I recently ran into problems with the config files and ssh modules, I just installed a fresh Raspbian image (version Feb 2020) but it still doesn't work. I found a couple of posts online of people experiencing the same but I haven't found a solution that worked for me yet.

    • I am using Python 3.7.5 for which a wheel should be accessible
    • I have updated and upgraded pip and the Pi to the newest versions

    Any ideas...?
    Thanks so much for help!

    You can install PySide2 on the Raspberry Pi using the below command:
    For python3:

    apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic
    

    For python2:

    apt-get install python-pyside2.qt3dcore python-pyside2.qt3dinput python-pyside2.qt3dlogic python-pyside2.qt3drender python-pyside2.qtcharts python-pyside2.qtconcurrent python-pyside2.qtcore python-pyside2.qtgui python-pyside2.qthelp python-pyside2.qtlocation python-pyside2.qtmultimedia python-pyside2.qtmultimediawidgets python-pyside2.qtnetwork python-pyside2.qtopengl python-pyside2.qtpositioning python-pyside2.qtprintsupport python-pyside2.qtqml python-pyside2.qtquick python-pyside2.qtquickwidgets python-pyside2.qtscript python-pyside2.qtscripttools python-pyside2.qtsensors python-pyside2.qtsql python-pyside2.qtsvg python-pyside2.qttest python-pyside2.qttexttospeech python-pyside2.qtuitools python-pyside2.qtwebchannel python-pyside2.qtwebsockets python-pyside2.qtwidgets python-pyside2.qtx11extras python-pyside2.qtxml python-pyside2.qtxmlpatterns python-pyside2uic
    

    I am already using it (atleast the basic widgets) and so far it's working great without any issues.



  • @Niagarer if you can use Arch Linux ARM OS on the RPi device, you can follow these steps to have a full PySide2 installation:

    1. Install PySide2
    pacman -S pyside2
    

    This action will install lots of dependencies: several X11 libraries; Qt 5.x and Python

    1. Optional dependencies for pyside2
    qt5-svg: QtSvg bindings
    qt5-script: QtScript bindings
    qt5-speech: QtTextToSpeech bindings
    qt5-websockets: QtWebSockets bindings
    qt5-webengine: QtWebEngine bindings
    qt5-datavis3d: QtDataVisualization bindings
    qt5-scxml: QtScxml bindings
    qt5-sensors: QtSensors bindings
    qt5-3d: Qt3D bindings
    qt5-x11extras: QtX11Extras bindings
    qt5-charts: QtCharts bindings
    qt5-tools: QtHelp bindings
    qt5-remoteobjects: QtRemoteObjects bindings
    
    1. Missing library libQml

    For the following error:

    ImportError: libQt5Qml.so.5: cannot open shared object file: No such file or directory

    fix by installing Qt QuickControls2

    sudo pacman -S qt5-quickcontrols2
    


  • @Pablo-J-Rogina Thanks, I don't use ArchLinux, just normal Raspbian but your answer is surely helpful for other people.
    Now, I just found this post where you also discussed that issue. Is PySide2 still unavailable for the Raspbian ARM? That would make me sad.



  • @Niagarer said in Installing PySide2 on Raspberry Pi:

    Is PySide2 still unavailable for the Raspbian ARM?

    I don't know, but unfortunately a bug report about that is still open...

    However, if you are dare enough :-) you may want to build it yourself.

    By checking the PKGBUILD file from Arch Linux ARM you may have an idea of what packages you need to installed in your RPi device in order to build PySide2 directly in the board



  • @Niagarer said in Installing PySide2 on Raspberry Pi:

    Hi,
    I am trying to install PySide2 on my Raspberry Pi.

    pip3 install PySide2
    

    raises an error:

    ERROR: Could not find a version that satisfies the requirement PySide2 (from versions: none)
    ERROR: No matching distribution found for PySide2
    

    Because I recently ran into problems with the config files and ssh modules, I just installed a fresh Raspbian image (version Feb 2020) but it still doesn't work. I found a couple of posts online of people experiencing the same but I haven't found a solution that worked for me yet.

    • I am using Python 3.7.5 for which a wheel should be accessible
    • I have updated and upgraded pip and the Pi to the newest versions

    Any ideas...?
    Thanks so much for help!

    You can install PySide2 on the Raspberry Pi using the below command:
    For python3:

    apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic
    

    For python2:

    apt-get install python-pyside2.qt3dcore python-pyside2.qt3dinput python-pyside2.qt3dlogic python-pyside2.qt3drender python-pyside2.qtcharts python-pyside2.qtconcurrent python-pyside2.qtcore python-pyside2.qtgui python-pyside2.qthelp python-pyside2.qtlocation python-pyside2.qtmultimedia python-pyside2.qtmultimediawidgets python-pyside2.qtnetwork python-pyside2.qtopengl python-pyside2.qtpositioning python-pyside2.qtprintsupport python-pyside2.qtqml python-pyside2.qtquick python-pyside2.qtquickwidgets python-pyside2.qtscript python-pyside2.qtscripttools python-pyside2.qtsensors python-pyside2.qtsql python-pyside2.qtsvg python-pyside2.qttest python-pyside2.qttexttospeech python-pyside2.qtuitools python-pyside2.qtwebchannel python-pyside2.qtwebsockets python-pyside2.qtwidgets python-pyside2.qtx11extras python-pyside2.qtxml python-pyside2.qtxmlpatterns python-pyside2uic
    

    I am already using it (atleast the basic widgets) and so far it's working great without any issues.



  • @lolcocks Thank you! I also just found out about that, in the bug report @Pablo-J-Rogina posted, somebody mentioned it.
    I do have a couple of little problems like

    • setting the Background of QSpinBoxes via stylesheet doesn't work anymore
    • using a file dialog fo an open file name sometimes has issues
    • etc.

    but overall it actually works way too good, I wasn't expecting that!
    Now I am happy. Very happy.
    For now this is solved I guess. If I run into huge problems, I will probably update here.



  • @lolcocks I did just this, and it seems to have installed everything correctly, but trying "import PySide2" within the venv that I installed everything gives a "no module named 'PySide2'". If, instead, I deactivate the venv and try to import the module, it works correctly. Any ideas?



  • @ckarpis you've probably figured this out by now but for anyone else stumbling into this the answer is to create (or recreate) the venv with --system-site-packages

    python3 -m venv your_venv_name --system-site-packages
    

    If you're re-creating the venv you don't need to delete it - just rerun the command and it won't remove any existing modules you've installed in that venv.

    Although some see it as 'bad form' to use this option it's much easier than trying to build/install pyside2 into each venv.



  • @lolcocks Thanks!
    I had to add "sudo" at the begining of the command line to make it work on my raspberry Pi 3B+.