2023-10-09 09:41 PM - last edited on 2023-10-10 02:01 AM by KDJEM.1
Hello Madam/sir,
Recently we have purchased STM32MP157F-DK2 development board, and we are very new to this board. We are trying to install PyQt5 on this board but we are getting error "Package not found" and also we are not getting proper link to install Python "GPIO Libraries"
So we required kind support for our future development by using this board.
Thanks and regards
Shailesh Parashar
Sr. R&D Engineer
Scientific Mes Technik Pvt. Ltd. Indore
Solved! Go to Solution.
2023-10-18 04:45 AM
Hello @Shail
Thank you very much for your piece of code.
If you add either this line
import PyQt5.sip
or this line
from PyQt5 import sip
into your python script, your error should disappear and the Qt window showing on the screen.
Best regards,
--JM
2023-10-18 10:59 PM
Hello @Jean-Marc B
I am grateful for your response and while I am using from PyQt5 import sip, I received following error:
from PyQt5 import sip
ImportError: cannot import name 'sip' from 'PyQt5' (/usr/lib/python3.11/site-packages/PyQt5/__init__.py)
And when using import PyQt5.sip, getting following error:
import PyQt5.sip
ModuleNotFoundError: No module named 'PyQt5.sip'
Thanks and Regards
Shail
2023-10-19 05:48 AM
Hi @Shail
That's curious...
These are the commands I did to see your application:
root@stm32mp1:~# cat > /home/weston/essai.py <<EOF
#!/usr/bin/env python3
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
from PyQt5 import sip
app = QApplication([])
mainWin = QMainWindow()
button = QPushButton("Hello, PyQt5!")
mainWin.setCentralWidget(button)
mainWin.show()
app.exec_()
EOF
root@stm32mp1:~# chmod +x /home/weston/essai.py
root@stm32mp1:~# su -l weston -c "env QT_QPA_PLATFORM=wayland-egl /home/weston/essai.py"
My installed python3-pyqt5 package is:
root@stm32mp1:~# apt-cache policy python3-pyqt5
python3-pyqt5:
Installed: 5.15.9-r0
Candidate: 5.15.9-r0
Version table:
*** 5.15.9-r0 500
500 http://packages.openstlinux.st.com/5.0 mickledore/updates armhf Packages
100 /var/lib/dpkg/status
root@stm32mp1:~# apt-cache depends python3-pyqt5
python3-pyqt5
Depends: libc6
Depends: libgcc1
Depends: libpython3.11-1.0
Depends: libstdc++6
Depends: python3-core
Depends: python3-pyqt5-sip
Depends: qtbase
Depends: qtdeclarative
Depends: qtquickcontrols2
Depends: qtquickcontrols2-mkspecs
Depends: qtwebkit
Depends: sip
Could you check from your side please?
Best regards
--JM
2023-10-19 09:43 PM - edited 2023-10-19 09:57 PM
Hello @Jean-Marc B
I am grateful for your response and I received the following output.
And still i am getting the following error.
root@stm32mp1:~# su -l weston -c "env QT_QPA_PLATFORM=wayland-egl /home/weston/essai.py"
Traceback (most recent call last):
File "/home/weston/essai.py", line 2, in <module>
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
ModuleNotFoundError: No module named 'PyQt5.sip'
Thanks & Regards,
Shail
2023-10-20 12:55 AM
Hi @Shail
That's disturbing!
Would it be possible to perform the following commands please?
root@stm32mp1:~# cat > pyqt5_help.py << EOF
#!/usr/bin/env python3
import PyQt5
help(PyQt5)
root@stm32mp1:~# python3 pyqt5_help.py | cat
This is my output from a fresh installation of OpenSTLinux 5.0 with additional installations of qtwayland and python3-pyqt5 packages:
root@stm32mp1:~# python3 pyqt5_help.py | cat
Help on package PyQt5:
NAME
PyQt5
DESCRIPTION
# Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file. Please review the
# following information to ensure the GNU General Public License version 3.0
# requirements will be met: http://www.gnu.org/copyleft/gpl.html.
#
# If you do not wish to use this file under the terms of the GPL version 3.0
# then you may purchase a commercial license. For more information contact
# info@riverbankcomputing.com.
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
PACKAGE CONTENTS
Qt
QtCore
QtGui
QtNetwork
QtPrintSupport
QtQml
QtQuick
QtQuickWidgets
QtWebKit
QtWebKitWidgets
QtWidgets
QtXml
pylupdate
pylupdate_main
pyrcc
pyrcc_main
sip
uic (package)
FILE
/usr/lib/python3.11/site-packages/PyQt5/__init__.py
Best regards,
--JM
2023-10-20 02:17 AM
Hello @Jean-Marc B
Your response is greatly appreciated. As you pointed out, I attempted and obtained the following outcome.
Thanks and Regards,
Shail
2023-10-20 03:03 AM
Hi @Shail
Ok, the sip entry is missing in your data while available in my output.
Could you get me the output of the following command please?
root@stm32mp1:~# apt-cache policy python3-pyqt5-sip
python3-pyqt5-sip:
Installed: 12.12.1-r0
Candidate: 12.12.1-r0
Version table:
*** 12.12.1-r0 500
500 http://packages.openstlinux.st.com/5.0 mickledore/updates armhf Packages
100 /var/lib/dpkg/status
I expect you will have the same output than mine. If yes, could you run this command:
root@stm32mp1:~# dpkg -L python3-pyqt5-sip
/.
/usr
/usr/lib
/usr/lib/python3.11
/usr/lib/python3.11/site-packages
/usr/lib/python3.11/site-packages/PyQt5
/usr/lib/python3.11/site-packages/PyQt5/sip.cpython-311-arm-linux-gnueabihf.so
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/LICENSE
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/LICENSE-GPL2
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/LICENSE-GPL3
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/METADATA
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/RECORD
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/WHEEL
/usr/lib/python3.11/site-packages/PyQt5_sip-12.12.1.dist-info/top_level.txt
If the output is similar to my output, please try to re-install the package python3-pyqt5-sip with the command:
root@stm32mp1:~# apt-get install --reinstall python3-pyqt5-sip
If it appears the package python3-pyqt5-sip is not installed, please install it with the command:
root@stm32mp1:~# apt-get install python3-pyqt5-sip
Then could you give me the ouput of the following commands please?
root@stm32mp1:~# ls /usr/lib/python3.11/site-packages/PyQt5/sip.cpython-311-arm-linux-gnueabihf.so -al
-rwxr-xr-x 1 root root 79104 Apr 13 2023 /usr/lib/python3.11/site-packages/PyQt5/sip.cpython-311-arm-linux-gnueabihf.so
root@stm32mp1:~# md5sum /usr/lib/python3.11/site-packages/PyQt5/sip.cpython-311-arm-linux-gnueabihf.so
1a8cfc12b75f9b131ecd4e122ebfd135 /usr/lib/python3.11/site-packages/PyQt5/sip.cpython-311-arm-linux-gnueabihf.so
Best regards,
--JM
2023-10-20 03:32 AM
Hello @Jean-Marc B
Your response is greatly appreciated and I thank you for your support. Although the problem has been solved, I still get an error message when I run the code.
root@stm32mp1:~# su -l weston -c "env QT_QPA_PLATFORM=wayland-egl /home/weston/essai.py"
qt.qpa.plugin: Could not find the Qt platform plugin "wayland-egl" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc.
Thanks and Regards,
Shail
2023-10-20 04:13 AM
Hi @Shail
I am very happy your problem is solved. Could you elaborate please about the solution you apply? It may be useful for other users.
About your last error message, please install the package qtwayland with the command:
root@stm32mp1:~# apt-get install qtwayland
Best regards,
--JM
2023-10-20 04:45 AM
Hello @Jean-Marc B
The issue was resolved successfully by the command below.
"apt-get install --reinstall python3-pyqt5-sip"
Now I am trying to run the file using python3 filename.py, but I am receiving the following error.
root@stm32mp1:~# su -l weston -c "env QT_QPA_PLATFORM=wayland-egl /home/weston/essai.py"
qt.qpa.plugin: Could not find the Qt platform plugin "wayland-egl" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc.
Thanks and Regards,
Shail