Skip to main content
Shail
Associate II
October 10, 2023
Solved

Query/issue in STM32MP157F-DK2

  • October 10, 2023
  • 1 reply
  • 9554 views

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

 

 

This topic has been closed for replies.
Best answer by Jean-Marc B

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 

1 reply

Erwan SZYMANSKI
Technical Moderator
October 10, 2023

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 :

  • Working with Distribution Package (= compiling the complete distribution). You can find all the information on this wiki
  • Check how to compile our default Qt example distribution here.
  • You will see that a Yocto recipe for pyqt5 is present here in Yocto layers: meta-qt5/recipes-python/pyqt5/python3-pyqt5_5.15.1.bb

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Erwan SZYMANSKI
Technical Moderator
October 11, 2023

@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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Shail
ShailAuthor
Associate II
October 16, 2023

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'

"