Pages

Showing posts with label PyQt6. Show all posts
Showing posts with label PyQt6. Show all posts

Monday, August 22, 2022

Fedora 37 : Install PyQt5 and PyQt6 on Fedora.

In this tutorial, I will show you how to install PyQt5 and PyQt6 on Fedora 37 Distro Linux.
I used the DNF tool on the sudo user.
To install PyQt5 I used this command:
[root@fedora mythcat]# dnf install python3-qt5.x86_64
Last metadata expiration check: 2:20:40 ago on Wed 17 Aug 2022 09:42:57 PM EEST.
Dependencies resolved.
...
Installed:
  openal-soft-1.22.2-2.fc37.x86_64                                              
  python-qt5-rpm-macros-5.15.6-7.fc37.noarch                                    
  python3-pyqt5-sip-12.11.0-2.fc37.x86_64                                       
  python3-qt5-5.15.6-7.fc37.x86_64                                              
  python3-qt5-base-5.15.6-7.fc37.x86_64                                         
  qt5-qtconnectivity-5.15.5-2.fc37.x86_64                                       
  qt5-qtlocation-5.15.5-3.fc37.x86_64                                           
  qt5-qtmultimedia-5.15.5-2.fc37.x86_64                                         
  qt5-qtsensors-5.15.5-2.fc37.x86_64                                            
  qt5-qtserialport-5.15.5-2.fc37.x86_64                                         
  qt5-qtsvg-5.15.5-2.fc37.x86_64                                                
  qt5-qttools-common-5.15.5-2.fc37.noarch                                       
  qt5-qttools-libs-designer-5.15.5-2.fc37.x86_64                                
  qt5-qttools-libs-help-5.15.5-2.fc37.x86_64                                    
  qt5-qtwebchannel-5.15.5-2.fc37.x86_64                                         
  qt5-qtwebsockets-5.15.5-2.fc37.x86_64                                         
  qt5-qtxmlpatterns-5.15.5-2.fc37.x86_64                                        

Complete!
If you want to use PyQt6 then you need to use the sip solution.
Let's search and install it with the DNF tool.
[root@fedora mythcat]# dnf search qt6 | grep python
Last metadata expiration check: 1:02:01 ago on Sun 21 Aug 2022 04:43:24 PM EEST.
python3-pyqt6-sip.x86_64 : The sip module support for PyQt6
[root@fedora mythcat]# dnf install python3-pyqt6-sip.x86_64
Last metadata expiration check: 1:02:24 ago on Sun 21 Aug 2022 04:43:24 PM EEST.
Dependencies resolved.
...
Installed:
  python3-pyqt6-sip-13.3.0-3.fc37.x86_64                                        

Complete!
I used the python command and I import PyQt5 and PyQt6
[mythcat@fedora ~]$ python
Python 3.11.0rc1 (main, Aug  9 2022, 00:00:00) [GCC 12.1.1 20220810 (Red Hat 12.1.1-4)] on linux
...
The python modules are installed and working well.

Saturday, November 6, 2021

Fedora 35 : PyQt6 and Python 3.

I tested the new python version 10 and pyqt version 6 on the fedora version 35 distribution.
[mythcat@fedora ~]$ python
Python 3.10.0 (default, Oct  4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
...
[mythcat@fedora ~]$ uname -a
Linux fedora 5.14.15-300.fc35.x86_64 #1 SMP Wed Oct 27 15:53:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
I install PyQt6 easy with pip tool:

[mythcat@fedora ~]$ pip install PyQt6 --user
Collecting PyQt6
  Downloading PyQt6-6.2.1-cp36-abi3-manylinux1_x86_64.whl (7.7 MB)
  ...
  Downloading PyQt6_Qt6-6.2.1-py3-none-manylinux_2_28_x86_64.whl (50.0 MB)
  ...
  Downloading PyQt6_sip-13.1.0-cp310-cp310-manylinux1_x86_64.whl (309 kB)
Installing collected packages: PyQt6-sip, PyQt6-Qt6, PyQt6
Successfully installed PyQt6-6.2.1 PyQt6-Qt6-6.2.1 PyQt6-sip-13.1.0
I tested with this python source code and it works fine.
import sys
from PyQt6.QtWidgets import QApplication, QWidget

def main():

    app = QApplication(sys.argv)

    w = QWidget()
    w.resize(250, 200)
    w.move(300, 300)

    w.setWindowTitle('Simple')
    w.show()

    sys.exit(app.exec())

if __name__ == '__main__':
    main()