pyqt4

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
eegrek39
Level 2
Level 2
Posts: 56
Joined: Fri Jun 19, 2015 9:30 am
Location: Norfolk

pyqt4

Post by eegrek39 »

I am trying to run a python program in eric and I am getting an error -
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on david-SATELLITE-C50-B, Standard
>>> Exception "unhandled ImportError"
No module named 'PyQt4'
File: /home/david/pyqt/firsttry.py, Line: 2

The program is a simple first try as follows
import sys
from PyQt4 import QtGui

def window():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
b = QtGui.QLabel(w)
b.setText("Hello World!")
w.setGeometry(100,100,200,50)
b.move(50,20)

w.show()
sys.exit(app.exec_())

if __name__ == '__main__':
window()

Has anyone any idea how to fix this. Have I installed pyqt4 in the wrong place for instance
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: pyqt4

Post by catweazel »

eegrek39 wrote: Sat Feb 24, 2018 4:18 am

Code: Select all

No module named 'PyQt4'
from PyQt4 import QtGui
Of course, you've installed PyQt4, yes?
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
eegrek39
Level 2
Level 2
Posts: 56
Joined: Fri Jun 19, 2015 9:30 am
Location: Norfolk

Re: pyqt4

Post by eegrek39 »

Thank you - I have loaded - python3-pyqt4 (4.11.4+dfsg-1build4) and it now works ok.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: pyqt4

Post by catweazel »

eegrek39 wrote: Sat Feb 24, 2018 5:36 am Thank you
You're most welcome.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Software & Applications”