pip install PyQt IOError

That’s because that file has a configure.py not a setup.py. configure.py generate a make file that you use to build pyqt against the qt lib you choose by passing –qmake option to configure.py, it has different options too. I suggest filing a bug with the pip maintainer.

Getting realtime output from ffmpeg to be used in progress bar (PyQt4, stdout)

In this specific case for capturing ffmpeg’s status output (which goes to STDERR), this SO question solved it for me: FFMPEG and Pythons subprocess The trick is to add universal_newlines=True to the subprocess.Popen() call, because ffmpeg’s output is in fact unbuffered but comes with newline-characters. cmd = “ffmpeg -i in.mp4 -y out.avi” process = subprocess.Popen(cmd, … Read more

Multiple inheritance metaclass conflict

The problem in your case is that the classes you try to inherit from have different metaclasses: >>> type(QStandardItem) <class ‘sip.wrappertype’> >>> type(ConfigParser) <class ‘abc.ABCMeta’> Therefore python can’t decide which should be the metaclass for the newly created class. In this case, it would have to be a class inheriting from both sip.wrappertype (or PyQt5.QtCore.pyqtWrapperType … Read more

Python: How to Resize Raster Image with PyQt

Create a pixmap: pixmap = QtGui.QPixmap(path) and then use QPixmap.scaledToWidth or QPixmap.scaledToHeight: pixmap2 = pixmap.scaledToWidth(64) pixmap3 = pixmap.scaledToHeight(64) With a 2048×1024 image, the first method would result in an image that is 64×32, whilst the second would be 128×64. Obviously it is impossible to resize a 2048×1024 image to 64×64 whilst keeping the same aspect … Read more

How to create a scrollable QVBoxLayout?

It turned out that I was lead down a wrong path by putting the layout as the layout of a widget. The actual way to do this is as simple as: scrollarea = QScrollArea(parent.widget()) layout = QVBoxLayout(scrollarea) realmScroll.setWidget(layout.widget()) layout.addWidget(QLabel(“Test”)) Which I’m pretty sure I tried originally, but hey it’s working. However this adds an issue … Read more

PyQt: RuntimeError: wrapped C/C++ object has been deleted

This answer to this question is as found here: Python PySide (Internal c++ Object Already Deleted) Apparently, assigning one widget to QMainWindow using setCentralWidget and then assigning another widget with setCentralWidget will cause the underlying c++ QWidget to be deleted, even though I have an object that maintains reference to it. Note: QMainWindow takes ownership … Read more