cancel
Showing results for 
Search instead for 
Did you mean: 

Query/issue in STM32MP157F-DK2

Shail
Associate II

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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 

View solution in original post

24 REPLIES 24
Erwan SZYMANSKI
ST Employee

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.

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

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'

"

Hello @Shail ,
Can you tell me the OpenSTLinux on which you are ? Is it OSTL v5.0 ?

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.

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.

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.

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.

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

Hi @Shail 

 

Could you share a piece of your code exposing the failure please so we can reproduce it?

Best regards

--JM

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