Home/Support/Support Forum/PyQt5 not working on DEY 2.6-r1
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

PyQt5 not working on DEY 2.6-r1

0 votes
Hello,

I installed PyQt5 on my ConnectCore6 using bitbake by adding this to the local.config:

IMAGE_INSTALL_append_pn-dey-image-qt " qtbase qttools python3-pyqt5"

Originally, th command import PyQt5 would fail. I solved this by adding a directory to the python path: export PYTHONPATH=/usr/share/sip:$PYTHONPATH

Now i can import PyQt5 core but when I try to make a simple GUI from: http://zetcode.com/gui/pyqt5/firstprograms/
I cannot complete the import statement: from PyQt5.QtWidgets import QApplication

I get the error: ImportError: cannot import name 'QApplication'

I have checked and the libraries are available under /usr/share/sip and QApplication appears to be there under QtWidgets. Can anyone help with using PyQt5 on the Connect Core Digi-embeded-yocto?
asked 4 days ago in Linux by DigiDabbler New to the Community (9 points)

Please log in or register to answer this question.

1 Answer

0 votes
 
Best answer
I got it working. I ran:
$ python3
And found the path from inside the python shell

>>> import sys
>>> sys.path

I poked around in the listed paths and found that PyQt5 was in /usr/lib/python3.5m/site-packages

The site-packages/ directory was not in the python path, so I added it to the path:

$ export PYTHONPATH=/usr/lib/python3.5m/site-packages:$PYTHONPATH
answered 4 days ago by DigiDabbler New to the Community (9 points)
...