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-22 10:44 PM
Hi @Shail
The Qt python script can not be executed with the command
python3 filename.py
You must copy the file into the weston account and run it with the command I mentionned i.e.
$ cp filename.py /home/weston/filename.py
$ su -l weston -c "env QT_QPA_PLATFORM=wayland-egl python3 /home/weston/filename.py"
Best regards,
--JM
2023-10-10 02:40 AM - edited 2023-10-15 11:42 PM
Hello @Shail and welcome on our MPU platform.
How did you try to install PyQt5 libraries / packages ?
I see that our distribution is able to provide PyQt5 stuff, but it will need some prerequisites :
Then, you can try to modify your configuration file to add the pyqt5 into your build. It would seems like...
<build_yocto>/conf/local.conf:
<... already existing conf file ...>
IMAGE_INSTALL:append = " \
python3-pyqt5 \
"
Then you can try something such as:
PC$> bitbake st-example-image-qt
All of this is an example, but I advice you to well follow the wiki mentioned above to understand all these steps.
Regards,
erwan.
2023-10-10 11:45 PM - edited 2023-10-10 11:45 PM
@Shail ,
One of my colleague have just let me realize that we provide this package on ST package repository.
The only thing you have to do is to link your board to an Ethernet connection, then :
apt-get update
apt-get install python3-pyqt5
See https://wiki.st.com/stm32mpu/wiki/Package_repository_for_OpenSTLinux_distribution for more information.
Kind regards,
Erwan.
2023-10-15 10:16 PM
I am grateful for your response and have successfully installed the PyQt5 library using the apt-get install python-pyqt5 command. I wrote a simple Python code using PyQt5 library, but when I run it, I am getting the following error.
"
Traceback (most recent call last):
File "/home/root/gui.py", line 2, in <module>
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
ModuleNotFoundError: No module named 'PyQt5.sip'
"
2023-10-16 03:25 AM
Hello @Shail ,
Can you tell me the OpenSTLinux on which you are ? Is it OSTL v5.0 ?
Kind regards,
Erwan.
2023-10-16 04:18 AM
Hello @erwan,
Following OpenSTLinux is running on STM32MP157F-DK2.
ID=openstlinux-weston
NAME="ST OpenSTLinux - Weston - (A Yocto Project Based Distro)"
VERSION="4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21 (mickledore)"
VERSION_ID=4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
VERSION_CODENAME="mickledore"
PRETTY_NAME="ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21 (mickledore)"
Kind regards,
Shail.
2023-10-17 09:31 AM
Hello @Shail ,
I suspect we have an internal integration issue with this python3-pyqt5 package on the last OpenSTLinux. We are working on it to find a solution, I will let you know ASAP if we find a correction.
Kind regards,
Erwan.
2023-10-17 09:49 PM
Hello @Erwan SZYMANSKI
I am grateful for your response and looking for best solution from your side to solve this issue.
we also need support (download link ) on Python library for GPIO control and SPI protocol.
Thanks & Regards,
Shail
2023-10-18 01:01 AM
Hi @Shail
Could you share a piece of your code exposing the failure please so we can reproduce it?
Best regards
--JM
2023-10-18 04:30 AM
Hello @Jean-Marc B
The following code i wrote.
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
app = QApplication([])
mainWin = QMainWindow()
button = QPushButton("Hello, PyQt5!")
mainWin.setCentralWidget(button)
mainWin.show()
app.exec_()
and while i run this code i am getting following error.
Traceback (most recent call last):
File "/home/root/but.py", line 1, in <module>
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
ModuleNotFoundError: No module named 'PyQt5.sip'
Thanks & Regards
Shail